Comments

It is possible to add a comment to an XML document. A comment is never considered part of the document text, so would not appear in published output. A comment may be inserted by a document author or editor to mark text that needs further treatment.

A comment declaration is used to create a comment. The keyword '--' identifies a comment declaration. For backward compatibility with SGML, the declaration must also end with the same two characters, and two adjacent hyphens must not appear within the comment text:

					<!-- This is a comment -->

<!-- This is an --
					ILLEGAL
					-- comment -->

SGML Note

A markup declaration that contains a comment ...

Get XML Companion, The, Third Edition 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.