Hyphens in xsl:comment element make it illegal : comment « XSLT stylesheet « XML






Hyphens in xsl:comment element make it illegal


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:template match="poem">
    <html>
      <xsl:comment>
        this is the comment
      </xsl:comment>
      <xsl:apply-templates />
    </html>
  </xsl:template>
</xsl:stylesheet>

Output:

<?xml version="1.0" encoding="UTF-8"?>The following is a revision.

 








Related examples in the same category

1.Add comments to generated xml
2.Create comment in style sheet
3.Copy comment with comment() function
4.match comment