Im trying to sort all elements, then attributes, which ive got working, however i cant figure out for the life of me how to remove attributes that are empty
Here is the sort XSLT
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates >
<xsl:sort select="local-name()"/>
</xsl:apply-templates>
</xsl:copy>
</xsl:template>
<xsl:template match="*[*]">
<xsl:copy>
<xsl:apply-templates select="@*" >
<xsl:sort select="local-name()" />
</xsl:apply-templates>
<xsl:apply-templates select="*" >
<xsl:sort select="local-name()"/>
</xsl:apply-templates>
</xsl:copy>
</xsl:template>
Thanks for any help
Well the only place where you process attribute nodes is
<xsl:apply-templates select="@*">so changing that to<xsl:apply-templates select="@*[normalize-space()]">might suffice.