|
Subject: [xsl] xsl:sort in reverse doc order From: Aditya <adi285@xxxxxxxxx> Date: Fri, 3 Mar 2006 15:53:28 -0800 |
I have an xml file which has the following representation from which i need
to extract user information in reverse documentation order -
<cc>
<mods>
<mod>
<usr>usr1</usr>
.......
</mod>
<mod>
<usr>usr2</usr>
.......
</mod>
<mod>
<usr>usr3</usr>
.......
</mod>
</mods>
</cc>
My output should look like
usr3
usr2
usr1
I used the following snippet of code but it doesnt seem to work as expected=
.
<xsl:template match=3D"/cc/mods">
<xsl:for-each select=3D"mod/usr">
<xsl:sort select=3D"position()" order=3D"descending" data-type=3D"t=
ext"/>
<xsl:value-of select=3D"."/>
<xsl:text>
</xsl:text>
</xsl:for-each>
</xsl:template>
Please let me know what i am doing wrong.
Thanks,
--
Aditya
"Vision is not enough; it must be combined with venture. It is not
enough to stare up the steps; we must step up the stairs." - Vaclav
Havel
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| RE: [xsl] Passing a Map as paramete, Michael Kay | Thread | Re: [xsl] xsl:sort in reverse doc o, G. Ken Holman |
| Re: [xsl] IE's conditional comments, Manfred Staudinger | Date | RE: [xsl] Passing a Map as paramete, DEVAL SHAH |
| Month |