Xml tree has two same nodes

Here is the segment from my A. yang:

grouping ethernet-vlan-service {
    list vlan {						
        key "vlan-id";			
        description "Ethernet service list"; 			
        tailf:cli-suppress-list-no;// block bulk deletion			
        leaf vlan-id{				
            type leafref {					
                path "/exa:config/exa:system/exa:vlan/exa:vlan-id";				
            }			
	}
    }      
} // end grouping ethernet-vlan-service	   

Here is the segment from my B. yang:

augment "/exa:config/exa:shelf/exa:slot/exa:interface/eth:ethernet" {
    uses exa:ethernet-vlan-service {
        refine vlan {
	    exa:driver "ifmgrd vlanmgrd pcmd l2hostmgrd l2v6hostmgrd pppoeiad";
            exa:command "$CMD_TYPE sd $XPATH{../../../slot-id}.$XPATH{../port}.$XPATH{vlan-id}  parent $XPATH{../../../slot-id}.$XPATH{../port}  vlan $XPATH{vlan-id}  service-name vlan$XPATH{vlan-id}  service-role $XPATH{../role}";
	}
    }

....
augment "/exa:config/exa:shelf/exa:slot/exa:interface/eth:ethernet/eth:vlan" {
    container access-group {	
        description "Apply an ACL to this interface";
	    uses acl:acl-containment ;			
        }
    }
}

Build yang to xml successfully. but there are two nodes of exa:config/exa:shelf/exa:slot/exa:interface/eth:ethernet**/eth:vlan**, which will cause my daemon some unexpected behavior.

Who can guide me ? thanks a lot.

Hello,

as pasted yang text was difficult to read, I have tried to reformat it (please review, thanks).

Please can you describe what is meant to build yang to xml successfully? Do you convert yang data model
to XML format?

Please, can you describe in more details the problem you are facing?

" there are two nodes of exa:config/exa:shelf/exa:slot/exa:interface/eth:ethernet**/eth:vlan**, which will cause my daemon some unexpected behavior."

I don’t see why you think there will be two ‘vlan’ nodes - the first augment adds it, the second augment adds ‘access-group’ as a child to the ‘vlan’ node added by the first augment (note that both ‘vlan’ and ‘access-group’ will have the namespace/prefix of B.yang).

Thanks @mnovak, I am not familar with the format text display. can you tell me how to do what you did?
Yes, we use pyang tool to convert all yang data model to one xml file.
The issue is the pyang convert all yang files to one xml file with two vlan nodes under exa:config/exa:shelf/exa:slot/exa:interface/eth:ethernet.
and when refine nested grouping doesn’t take effect on both vlan nodes and only one vlan node has the refined information.
Is it the pyang tools problem? thanks.

@per, you are right. It should be only one node. But the pyang build all yang files to one xml file with two vlan nodes.
If I rectify the yang as following and will only see one node in the xml file.

augment "/exa:config/exa:shelf/exa:slot/exa:interface/eth:ethernet" {
    uses exa:ethernet-vlan-service {
        refine vlan {
	    exa:driver "ifmgrd vlanmgrd pcmd l2hostmgrd l2v6hostmgrd pppoeiad";
            exa:command "$CMD_TYPE sd $XPATH{../../../slot-id}.$XPATH{../port}.$XPATH{vlan-id}  parent $XPATH{../../../slot-id}.$XPATH{../port}  vlan $XPATH{vlan-id}  service-name vlan$XPATH{vlan-id}  service-role $XPATH{../role}";
	}
        augment vlan 
        {
           container access-group {	
               description "Apply an ACL to this interface";
	       uses acl:acl-containment ;			
            }
       }
    }

For formatting you can use github markdown.

Start and end code with reversed apostrophe:

Maybe you can describe exactly what you do with ‘pyang’? As far as I know, it does not provide a way to do such a thing out-of-the-box at least.

Thanks @mnovak. I’ll try to be familiar with that.

Thanks @per, I think you are right. Now our company add some additional format para to pyang. I have asked for other related college for help.