| Advertise Here |
DEVELOPER CHANNEL |
XSL SortWhere to put the Sort InformationTake a new look at the XML document that you have seen in almost every chapter (or open it with IE5):
To output this XML file as an ordinary HTML file, and sort it at the same time, simply add an order-by attribute to your for-each element like this: <xsl:for-each select="CATALOG/CD" order-by="+ ARTIST"> The order-by attributes takes a plus (+) or minus (-) sign, to define an ascending or descending sort order, and an element name to define the sort element. Now take a look at your slightly adjusted XSL stylesheet (or open it with IE5):
Transforming it on the ClientHere is the simple source code needed transform the XML file to HTML on the client (try it yourself):
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Jump to : Top Of Page or HOME |