[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Using xsl:sort to sort negative values
Can anyone tell why the code below will not work? <xsl:sort select="data" data-type="number"/> well, we have to guess, as you haven't shown the relevant part of your code, but my guess is that you have <xsl:for-each select="data"> <xsl:sort select="data" data-type="number"/> which means that the sort key in each case is the string value of the data child of the current data element, converted to a number, but as there are no such elements all elements get the same sort key (NaN in xslt1, () in xslt2) and so no sorting happens. use <xsl:sort select="." data-type="number"/> as you want the value of the element itself, not of a child. David
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|