Jak wyeliminować wszystkie <TAG /> i wszystkie atrybuty = „” przez XSLT?

Wxsl:stylesheet Mam transformację „podobną do tożsamości”, aby wyeliminować komentarze, puste (terminal) znaczniki i puste atrybuty ... Aledruga xsl:when nie działa

  <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>

Jak wyrazić warunek, aby opróżnić tagi w tym kontekście?

PS: „puste zasady” sąwyjaśniono tutaj, Staram się go używać, ale nie rozumiem, dlaczego nie działa.

questionAnswers(1)

yourAnswerToTheQuestion