Comments

An XML comment can be created using the Comment element. When output, the start-tag is replaced with '<!--' and the end-tag with '-->':

<comment>This is a comment</comment>


   <!--This is a comment-->
				

Content limitations

Because the '-' symbol is significant in the final comment markup, there are some constraints on its use in the text. An error may be reported if '--' appears in the text, as it would signify early temination of the comment. An error may also be reported if a single '-' symbol ends the comment:

<comment>The -- sequence is illegal, as is -</comment>


   <!--The -- sequence is illegal, as is --->

Alternatively, a more sophisticated XSLT processor may recover from such problems on the user's behalf, by inserting spaces at ...

Get XSL companion, The now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.