[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] generic sort based on attribute names


Subject: [xsl] generic sort based on attribute names
From: "Chaitanya Desai" <cdesai@xxxxxxxxxxx>
Date: Sat, 22 Jan 2005 19:23:21 -0800

Hi,
I am trying to write a generic sort that uses the 'concatenated
name-value pairs of all attributes sorted' as the key to sort elements
at a particular level.
Example
Suppose
<root>
 <e b="bb" y="yy"/>
 <e z="zz" a="aa"/>
</root>
is the XML I want to sort.
The result of the sort should be
<root>
  <e a="aa" z="zz" />
  <e b="bb" y="yy" />
</root>
Thus the attributes within an element are sorted and then the key used
for sorting elements would be:
'az' and 'by' respectively (thus 'az' < 'by').
I am able to sort attributes within an element.
But I am having trouble setting the key to sort for elements.
Any help would be greatly appreciated.
Thanks
Chaitanya


Current Thread
Keywords
xml