SAX: Comments (question 7 of 10)
ak117 at freenet.carleton.ca
Sat Jan 3 18:25:29 GMT 1998
[SAX is a proposal for a simple, event-based XML API, using
callbacks. This is one in a series of ten design questions that we
need to answer to implement the API.]
Should SAX include an event for comments?
public void comment (char ch, int length);
- comments are purely lexical, and do not form an integral part of a
document's information set for processing (as opposed to authoring
- including comments in SAX might encourage comment abuses like those
- the DOM includes comments in the core level-one implementation;
- HyTime uses comments for lexical constraints.
SAX is not designed for authoring tools or repositories, that need to
preserve the lexical as well as the logical structure of a document,
and there is no compelling reason to report comments here except for
DOM building (and we can always leave them out of a DOM).
The conventional comments in HyTime are not required, and personally,
I believe that they should not have been there in the first place.
Another lexical feature that I am not discussing here is CDATA
sections; I assume that, when the parser is reporting character data,
it does not matter how the parser obtained those characters (in a
CDATA section, or in regular #PCDATA with the delimiters escaped using
references). I am happy, of course, to listen to other opinions on
All the best,
David Megginson ak117 at freenet.carleton.ca
Microstar Software Ltd. dmeggins at microstar.com
xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)
More information about the Xml-dev