|
Subject: Re: [xsl] xsl:sort in reverse doc order From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Fri, 03 Mar 2006 22:15:23 -0500 |
My output should look like
usr3 usr2 usr1
I used the following snippet of code but it doesnt seem to work as expected.
T:\ftemp>type aditya.xml <cc> <mods> <mod> <usr>usr1</usr> ....... </mod> <mod> <usr>usr2</usr> ....... </mod> <mod> <usr>usr3</usr> ....... </mod> </mods> </cc>
T:\ftemp>type aditya.xsl <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/"> <xsl:apply-templates select="/cc/mods"/> </xsl:template>
<xsl:template match="/cc/mods">
<xsl:for-each select="mod/usr">
<xsl:sort select="position()" order="descending" data-type="text"/>
<xsl:value-of select="."/>
<xsl:text>
</xsl:text>
</xsl:for-each>
</xsl:template></xsl:stylesheet> T:\ftemp>xslt aditya.xml aditya.xsl con usr3 usr2 usr1
-- Upcoming XSLT/XSL-FO hands-on courses: Washington,DC 2006-03-13/17 World-wide on-site corporate, govt. & user group XML/XSL training. G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) Male Cancer Awareness Aug'05 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] xsl:sort in reverse doc order, Aditya | Thread | [xsl] XSLT as a programming languag, Laurent Lasudry |
| RE: [xsl] Is letting the browser tr, Didier PH Martin | Date | Re: [xsl] Is letting the browser tr, M. David Peterson |
| Month |