Hi!
I am unsure if this is an error, or if this is just how XSLT sort works.
When I do the following:
<xsl:apply-templates select="//*[@id<=50000]">
<xsl:sort select="@id" />
</xsl:apply-templates>
The results are not being sorted as if they are numbers.
For example I would get the following results:
@id 0
@id 1
@id -1
@id 100
@id -100
@id 12345
@id 2
@id -2
@id 200
etc..
But I would like results to be:
@id -100
@id -2
@id -1
@id 0
@id 1
@id 2
@id 100
@id 200
@id 12345
etc..
How can I get the sort to treat the results numerically?
I know number() can convert a string to a number, but I don't know how this would be used in this context.
Any suggestions of what I can do to fix this would be appreciated :)