[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: hierarchical sorting problem
Hi > -----Original Message----- > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of > Andy_Freeman@xxxxxx > Sent: Monday, October 06, 2003 8:09 PM > To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx > Subject: hierarchical sorting problem > > > I am trying to sort an XML document by a variety of different > attributes. Here is an example of the source document: > (...) > > I need to sort by the Product ActionCode attribute at either > level to produce the following output: > (...) > > I also need to sort by the Product|Group MaterialNumber > attribute to produce the following output: > Try this: <xsl:template match="*"> <xsl:copy> <xsl:copy-of select="@*"/> <xsl:apply-templates> <xsl:sort select="@ActionCode"/> <xsl:sort select="@MaterialNumber" data-type="number"/> </xsl:apply-templates> </xsl:copy> </xsl:template> This it's a version of the identity transform. You copy the current element and apply-templates in sorted order Regards, Americo Albuquerque XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|