[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

xsl:sort in reverse doc order

Subject: xsl:sort in reverse doc order
From: Aditya <adi285@xxxxxxxxx>
Date: Fri, 3 Mar 2006 15:53:28 -0800
xsl sort reverse order
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.