0
<xs:complexType name="common">
  <xs:attr name="audio" type="xs:string" use="required" />
  <xs:attr name="firmware" type="xs:string" use="optional" />  
  <xs:attr name="recording" type="xs:unsignedShort" use="required"/>
<xs:complexType/>

I want to sort the xml above by attribute "use" and make sure all of the
elements with "required" would be on top, something like

<xs:complexType name="common">
  <xs:attr name="audio" type="xs:string" use="required" />  
  <xs:attr name="recording" type="xs:unsignedShort" use="required"/>
  <xs:attr name="firmware" type="xs:string" use="optional" />  
<xs:complexType/>

According to pugixml, call std::sort would not give user expected result
because it would not affect the local handle which store in the iterator
The easiest solution for me is make a copy of node "complexType"
sort the iterator of the copy
and assign the value of copy to the original nodes(haven't experienced yet)

Could I sort the nodes with other cheaper and easier solution?
Thanks a lot

Edited by stereomatching: n/a

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by mazzica1
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.