Skip to Content
XML Pocket Reference, 3rd Edition
book

XML Pocket Reference, 3rd Edition

by Simon St. Laurent, Michael Fitzgerald
August 2005
Intermediate to advanced
175 pages
4h 48m
English
O'Reilly Media, Inc.
Content preview from XML Pocket Reference, 3rd Edition

Comments

XML comments contain human-readable information and are formed the same way SGML (and thus HTML) comments are formed.

Productions

[15] Comment ::= '<!--' ((Char - '-') | ('-' (Char - '-')))* '-->'

Examples

<!--This is a very simple document.-->

<!--
   This comment is on
   several lines.
-->

Description

Comments begin with <!-- and end with —>. They can contain characters that are illegal in text (character data) such as & and <; however, they can’t contain the character sequence -- or --->, and they cannot be nested. XML processors generally ignore comments but may keep track of them. You can place comments anywhere in an XML document except inside other markup, such as within tag brackets. You can also place comments inside document type declarations, where allowed. Entity references and parameter entity references (such as &lt; or %data;) are allowed but not recognized or expanded inside comments.

See also

§2.5

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Special Edition Using XML, Second Edition

Special Edition Using XML, Second Edition

- et al. David Gulbransen
.NET & XML

.NET & XML

Niel M. Bornstein
Succeeding as a First-Time Parent (HBR Working Parents Series)

Succeeding as a First-Time Parent (HBR Working Parents Series)

Harvard Business Review, Daisy Dowling, Eve Rodsky, Bruce Feiler, Amy Jen Su

Publisher Resources

ISBN: 9780596100506Errata Page