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

[xsl:sort] sort by text that correspond to code in xml

Subject: [xsl:sort] sort by text that correspond to code in xml
From: Matts Isuls <matts.isuls@xxxxxxxxxxx>
Date: Fri, 17 Jan 2003 13:10:33 +0200
becker be 4410
Let's say i have a xml file like this:


<root>
...
...
<lunastusarvot>
  <lunastusarvo>
    <arvo_osalajikoodi>4410</arvo_osalajikoodi>
    <tunnus>12</tunnus>
    <nimi>ALLMÄN VÄG</nimi>
  </lunastusarvo>
  <lunastusarvo>
    <arvo_osalajikoodi>2300</arvo_osalajikoodi>
    <tunnus>5</tunnus>
    <nimi>ALLMÄN VÄG</nimi>
  </lunastusarvo>
  ..
  ..
<lunastusarvot>
...
...
</root>

and i would have to sort the by <arvo_osalajikoodi>. But not by the number
(4410,2300) rather by the text that the codes correspond to. The code is
changed to text by a template.

<xsl:for-each select="../lunastusarvo">
  <!-- this sorts by the code -->
  <xsl:sort select="lunastuslajikoodi" data-type="number" />
  <!-- and this doesn't work obviously -->
  <xsl:sort><xsl:apply-templates
    select="$lunastuslaji-koodisto"><xsl:with-param name="arvo" 
    select="lunastuslajikoodi"/></xsl:apply-templates></xsl:sort>
  ..
  ..
</xsl:for-each>


Regards,
  Matts Isuls

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.