XSLT - remove all attributes

xml, xslt, xslt-1.0

Solution

Your solution should work without issue, but there's an even easier way - just use an identity template that doesn't include attributes:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output omit-xml-declaration="yes" indent="yes"/>
  <xsl:strip-space elements="*"/>

  <xsl:template match="node()">
    <xsl:copy>
      <xsl:apply-templates />
    </xsl:copy>
  </xsl:template>
</xsl:stylesheet>

Problem

Pretty straightforward question. Didn't find an answer to exactly this one. Would like to see XSLT 1.0 without attribute axis, and others too if possible (I am using python's lxml lib which is not really catching up on that stuff).

Original source