XML Sorting for Numbers in Descending Order
The XML code of Arrange Numbers in Descending order will be used to process file data. The number set in a data file will be rearranged and displayed in descending order
Descending Order Sorting in XML
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="UTF-8" />
<xsl:template match="content/collection/">
<xsl:apply-templates>
<xsl:sort select="@promotionid" order="descending" data-type="number" />
</xsl:apply-templates>
</xsl:template>
<xsl:template match="content/collection/data">
<xsl:if test="position()=1">
<xsl:value-of select="@promotionid"/>
</xsl:if>
</xsl:template>
</xsl:stylesheet>