hi,

I'm having problems with a sort.

my requirement is to sort some xml, and indent the result. I can do the indent bit, but the sorting is failing.

My xml is as follows :

<xml>
<root_elem>
<item_elem>
 <value1> xyz</value1>
 <value2> asd </value2>
 ...
</item_elem>
<item_elem>
 ...
</item_elem>
</root_elem>

Basically I want to sort all the "item_elem" elements based on the value of the "value1" sublements.

However, the names of these elements are dynamic, and there is where I am having difficulty. I.e., in another document, "root_elem", "item_elem" and "valueX" could have different names, but the structure is the very same.

I need to sort the childred of the root element by _their_ first child.

Is there a generic way to do this ?

Can the result be indented in the same operation ?

Any help appreciated.

Peter

_________________________________________________________________
Be the first to hear what's new at MSN - sign up to our free newsletters! http://www.msn.co.uk/newsletters

Reply via email to