xsl aggregate or subquery

Unarutouz

New Member
For an XML file that has the following structure\[code\] <?xml version="1.0" encoding="UTF-8"> <farm xmlns:my="mynamespace.com" > <pen> <sheep> 3 </sheep> <cow> 3</cow> <pig> 2</pig> <chicken> 5</chicken> </pen> <pen> <sheep> 12 </sheep> <cow> 1</cow> <pig> 2</pig> <chicken> 4</chicken> </pen> <pen> <sheep> 4 </sheep> <cow> 4</cow> <pig> 1</pig> <chicken> 2</chicken> </pen> </farm>\[/code\]I have an xsl style sheet that loops through each pen node(for-each), generates an id for each animal type, i.e. sheep,cow,pig and chicken and counts the total. Generating a table as below\[code\]ANIMAL | VALUE-----------------pig | 5cow | 8sheep | 19chickens | 11\[/code\]Now I would like to have this resultset sorted, by the value columnIs it possible to do the equivalent of a subquery using XSL?
 
Back
Top