Section 15.8.  Comments

Prev don't be afraid of buying books Next

15.8. Comments

Sometimes it is useful to embed information about a document or its markup in a manner that will be ignored by computer processes and renditions of the document. For example, you might insert a note to yourself to clean up the wording of a section, a note to a co-author explaining the reason for a particular section of the document, or a note in a DTD describing the semantics of a particular element. This information can be hidden from the application in a comment. Comments should never be displayed in a browser, indexed in a search engine, or otherwise processed as part of the data of the actual document.

Example 15-23. A comment
 <!-- This section is really good! Let's not change it. --> 

Comments consist of the characters "<!--" followed by almost anything and ended by "-->". The "almost anything" in the middle cannot contain the characters "--". This is a little bit inconvenient, because people often use those two characters as a sort of dash, to separate thoughts. This is another point to be careful of, lest you get bitten.

Comments can go just about anywhere in the instance or the prolog. However, they are not permitted within declarations, tags, or other comments.

Markup is not recognized in comments. You can put less-than and ampersand symbols in them, but they will not be recognized as the start of elements or entity references.

Amazon


XML in Office 2003. Information Sharing with Desktop XML
XML in Office 2003: Information Sharing with Desktop XML
ISBN: 013142193X
EAN: 2147483647
Year: 2003
Pages: 176

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net