Create comment in style sheet : comment « XSLT stylesheet « XML






Create comment in style sheet


File: Data.xml

<documentation>The following is a revision.</documentation>

File: Transform.xslt
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  version="1.0">
  <xsl:output method="xml" omit-xml-declaration="yes" indent="no" />
  
  <xsl:template match="documentation">
    <xsl:comment>
      <xsl:apply-templates />
    </xsl:comment>
  </xsl:template>

  
</xsl:stylesheet>

Output:

<!--The following is a revision.-->

 








Related examples in the same category

1.Add comments to generated xml
2.Hyphens in xsl:comment element make it illegal
3.Copy comment with comment() function
4.match comment