Como eliminar todos os <TAG /> e todos os atributos = "" por XSLT?
Em umxsl:stylesheet
Eu tenho essa transformação "identidade like", para eliminar comentários, tags vazias (terminais) e atributos vazios ...segundo xsl:when
não funciona
<xsl:template match="node()">
<xsl:choose>
<xsl:when test="name()='p' and not(./*) and not(normalize-space(.))"></xsl:when>
<xsl:when test="not(name()='img') and not(name()='br') and not(./*) and not(text())"
></xsl:when> <!-- this line NOT WORKS -->
<xsl:otherwise><xsl:copy><xsl:apply-templates select="@*|node()"/></xsl:copy></xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="@*">
<xsl:choose>
<xsl:when test="not(normalize-space(.))"></xsl:when>
<xsl:otherwise><xsl:copy><xsl:apply-templates select="@*|node()"/></xsl:copy></xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="comment()"></xsl:template>
Como expressar condição para tags vazias nesse contexto?
PS: as "regras vazias" sãoexplicado aqui, Eu tento usá-lo, mas não vejo porque não funciona.