Petterson Mikael wrote:
Well I still don't get any sorting done!
Not sure what you are trying, with the example input being
<?xml version="1.0" encoding="UTF-8"?>
<package-list>
<package name="se.company.product.subproduct.boam.fpx.testsignals" />
<package
name="se.company.product.subproduct.boam.mao.iface.enum.hidden" />
</package-list>
and an example stylesheet being
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:xsl="
http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl
utput method="xml" indent="yes" />
<xsl:template match="package-list">
<xsl:copy>
<ascending>
<xsl:apply-templates select="package">
<xsl:sort select="@name" data-type="text" order="ascending" />
</xsl:apply-templates>
</ascending>
<descending>
<xsl:apply-templates select="package">
<xsl:sort select="@name" data-type="text" order="descending" />
</xsl:apply-templates>
</descending>
</xsl:copy>
</xsl:template>
<xsl:template match="package">
<xsl:copy>
<xsl:copy-of select="@*" />
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
the output is
<?xml version="1.0" encoding="UTF-8"?>
<package-list>
<ascending>
<package name="se.company.product.subproduct.boam.fpx.testsignals"/>
<package
name="se.company.product.subproduct.boam.mao.iface.enum.hidden"/>
</ascending>
<descending>
<package
name="se.company.product.subproduct.boam.mao.iface.enum.hidden"/>
<package name="se.company.product.subproduct.boam.fpx.testsignals"/>
</descending>
</package-list>
so sorting works.
Of course it depends on the parts of the package names to have the same
lengths so you might want to do
<xsl:sort select="translate(@name, '.', '')"
perhaps depending on what kind of names you want to sort.