[xsl] generic sorting problem

Subject: [xsl] generic sorting problem
From: "peter willard donisthorpe" <paytur@xxxxxxxxxxx>
Date: Tue, 06 Sep 2005 19:21:50 +0000
hi,

I'm having problems with a sort.

I wish to sort some xml, and indent the result. I can do the indent, but the sorting is proving a problem.

My xml will be in the format of the below, though the element names may differ per document.

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

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

As per abovve, the names of these elements are dynamic, and this 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 children 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

_________________________________________________________________
MSN Messenger 7.5 is now out. Download it for FREE here. http://messenger.msn.co.uk


Current Thread