[Home] [By Thread] [By Date] [Recent Entries]
I want to transform the following...
<root>
<rec>
<name>z</name>
<year>2004</name>
</rec>
<rec>
<name>z</name>
<year>2005</year>
</rec>
<rec>
<name>a</name>
<year>2002</year>
</rec>
<rec>
<name>a</name>
<year>2003</year>
</rec>
</root>...to...
In other words, sort by <name> ascending and then by <year> descending while tagging the most recent of each name. The sorting is easy, but tagging the most recent is proving difficult for me. I thought to use the preceding axis to test the preceding name and if it is different than the current name put in the tag attribute, but as I understand it, the precding axis applies to document order, not sort order. Is there some better way to do this? Thanks, Stan Dyck
|

Cart



