When sorting in default mode, the sorting is performed using alphabetic string comparisons. If numbers are to be sorted according to their numeric value, data-type must be set to "number".
XSLT <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/> <xsl:template match="/"> <number> <xsl:apply-templates select="/aaa/bbb"> <xsl:sort data-type="number"/> </xsl:apply-templates> </number> <default> <xsl:apply-templates select="/aaa/bbb"> <xsl:sort/> </xsl:apply-templates> </default> </xsl:template> <xsl:template match="bbb"> <bbb> <xsl:value-of select="."/> </bbb> </xsl:template> </xsl:stylesheet> |
|
XML <aaa> <bbb>231</bbb> <bbb>111</bbb> <bbb>1</bbb> <bbb>42.1</bbb> <bbb>370</bbb> <bbb>50</bbb> </aaa> | Output <number> <bbb>1</bbb> <bbb>42.1</bbb> <bbb>50</bbb> <bbb>111</bbb> <bbb>231</bbb> <bbb>370</bbb> </number> <default> <bbb>1</bbb> <bbb>111</bbb> <bbb>231</bbb> <bbb>370</bbb> <bbb>42.1</bbb> <bbb>50</bbb> </default> |
Previous chapter: | Number Formatting |
Next chapter: | Axes |
Previous page: | Sorting according to case |
Next page: | Sorting according to several criteria |
You can also get Organic Skin Care products from Bliss Bath Body and you must check out their Natural Body Lotions and bath soaps
Now if you are looking for the best deals on surf clothing from Quiksilver and Roxy then you have to check these amazing deals here:
Hey, check out this Organic Skin Care European Soaps along with Natural Lavender Body Lotion and shea butter
and we can get surf t shirts surfing shirt and And you must check out this website swim suit swimming suit and swim trunks