July 2002
Intermediate to advanced
864 pages
22h 32m
English
Although we've mentioned comments briefly before, we're mentioning them one last time here in detail to make sure you understand their usage, and to make a point about working with code in documents and DTDs.
Both XML files and Document Type Definitions may contain comments, which are simply pieces of text that are completely ignored by the XML parser, so they can contain just about anything you want to put in them.
Contents in XML take the form
<!-- Comment -->
The comment must begin with the <!-- string, and it must end with the --> string. Here's an example of a comment:
<!-- This is my XML document. -->
If we had
<!- This is not a valid comment -->
or
<!-- This is also not a valid comment ->
it would not be a valid comment. ...