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

<xsl:sort> Q

Subject: <xsl:sort> Q
From: mxmodi@xxxxxxxxxxxxxxx
Date: Tue, 21 Nov 2000 17:52:14 -0600
xsl sort select name
Hi,

I have a simple sort Q. I am trying to sort numbers for a select box in
ascending order. After running it through the  XSLT processor, what I do
get is a sort, however, it is sorting based on the first digit of the
number. By doing so, it considers the number "3" to be greater than the
number "27". How do I avert this sorting? ANd I cannot make ID as an
attribute.

Here is a sample XML"

<Names>
  <Name>
    <Description>abc</Description>
    <ID>30</ID>
  </Name>
  <Name>
    <Description>aaa</Description>
    <ID>7</ID>
  </Name>
  <Name>
    <Description>bbb</Description>
    <ID>27</ID>
   </Name>
  <Name>
    <Description>bbb</Description>
    <ID>2</ID>
   </Name>
</Names>


Sample XSL:

...
<xsl:template match="/">
<select name="numberlistbox" size="10">
     <xsl:apply-templates select="Names/Name">
          <xsl:sort select="ID" />
     </xsl:apply-templates>
</select>
...
</xsl:template>

<xsl:template match="Name">
<option>
<xsl:value-of select="ID" />
</option>
</xsl:template>

Result:

ID's are:
2
27
30
7

Desired result:

2
7
27
30

Any help is appreciated.

Thanks,

Maulik


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


Current Thread
  • <xsl:sort> Q
    • mxmodi - Tue, 21 Nov 2000 17:52:14 -0600 <=
      • Mike Brown - Tue, 21 Nov 2000 17:56:42 -0700 (MST)
      • <Possible follow-ups>
      • Kay Michael - Wed, 22 Nov 2000 11:35:17 -0000

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.