2.2.3 [XML] Section 2.5, Comments


The specification states:

 Definition: Comments may appear anywhere in a document outside other markup; in 
 addition, they may appear within the document type declaration at places allowed by 
 the grammar. They are not part of the document's character data; an XML processor 
 MAY, but need not, make it possible for an application to retrieve the text of 
 comments. For compatibility, the string "--" (double-hyphen) MUST NOT occur within 
 comments.] Parameter entity references MUST NOT be recognized within comments.


The following clarifications apply:

  • Comment text can be retrieved.

  • A valid comment can contain a double hyphen ("--") when the double hyphen is represented by the character reference "--".