Skip to Main Content
SAX2
book

SAX2

by David Brownell
January 2002
Intermediate to advanced content levelIntermediate to advanced
240 pages
6h 58m
English
O'Reilly Media, Inc.
Content preview from SAX2

Comment Information Items

Comments are intended for human consumption; processing instructions are reserved for application data. The main curiosity here is that the Infoset doesn’t believe in comments within DTDs, perhaps on the grounds that they’d need to be associated with the declarations they describe. (Some DTD documentation tools rely on magic comment syntax, much like javadoc.)

Property

Callbacks

Explanation

[content]

LexicalHandler.comment()

The characters identified in this callback are the contents of the comment.

[parent]

When startElement() is invoked with no matching endElement(), the parent is the current element. The Infoset ignores comments reported between calls to LexicalHandler.startDTD() and LexicalHandler.endDTD(). Otherwise, the document itself is the parent.

Some legacy applications use comments to represent the sort of information that processing instructions were designed to hold; an example is wrapping of CSS rendering hints in HTML comments.

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

Publisher Resources

ISBN: 0596002378Supplemental ContentCatalog PageErrata