I found that the current sort xslt did not do any sorting on my JDF XML files.
This works better. It first sorts the attributes and then the elements.
I tested it with a few of my XML (JDF) files and it worked well.
Hopefully it is universal
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@*">
<xsl:sort select="name()"/>
</xsl:apply-templates>
<xsl:apply-templates select="node()">
<xsl:sort select="name()"/>
</xsl:apply-templates>
</xsl:copy>
</xsl:template>
This works better. It first sorts the attributes and then the elements.
I tested it with a few of my XML (JDF) files and it worked well.
Hopefully it is universal
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@*">
<xsl:sort select="name()"/>
</xsl:apply-templates>
<xsl:apply-templates select="node()">
<xsl:sort select="name()"/>
</xsl:apply-templates>
</xsl:copy>
</xsl:template>
Comment