How to comment in XSLT and not HTML

Kirk Strobeck picture Kirk Strobeck · Dec 10, 2010 · Viewed 59.5k times · Source

I'm writing XSL and I want to make comments throughout the code that will be stripped when it's processed, like PHP, however I'm not sure how.

I'm aware of the comment object, but it prints out an HTML comment when processed. :\

<xsl:comment>comment</xsl:comment>

Answer

Kathy Van Stone picture Kathy Van Stone · Dec 10, 2010

You use standard XML comments:

<!-- Comment -->

These are not processed by the XSLT transformer.