SAX2: LexicalHandler

Khun Yee Fung kyeefung at
Wed Dec 22 17:13:31 GMT 1999

		David Megginson [david at] wrote:

		... Personally, I think that the XML
		community would be better served if purely lexical items
		Namespace prefixes, the DOCTYPE declaration, comments,
element type
		declarations, entity boundaries, etc. were simply
inaccessible through
		any standard API -- that way, the APIs would be easier to
learn and
		the obfuscators of the world would be less likely to abuse

I hope you are not talking about people who use the APIs. If the people who
have to use APIs did not have to look at these things, they would not want
them in any APIs. Personally, I do not believe people who write
specifications will look at XML APIs to limit their imagination. They will
look at what is in an XML document. And API writers will then have to make
sure their APIs can do everything under the Sun. Or the people who have to
implement the specifications will just do it themselves or not implement the
specifications at all.

If SAX2 had not given me the comment nodes in XML documents, I would not
have switched to SAX. I would have stayed in DOM for my little
implementation of XPath. Or, more likely, I would have started implementing
my own XML parser. I did not specify XPath. As an implementor, I will choose
the tool that allows me to do my work.

And in general, it is not a problem we can avoid. How many people need to
get the comments of a Java program in source form? I can think of a few:
people who have to implement something like JavaDoc. The ordinary Joe would
not think of implementing JavaDoc because not that many people can handle
it. I see it as a strength rather than a weakness for everybody in XML to be
able to access anything in an XML document. And SAX is doing a wonderful
job. And I thank you very much for that.

		I am tired, however, from all the e-mails from DOM
implementors who
		want comments (for example) in SAX so that they can bloat
their DOM
		trees with them.  They're wrong, of course, but I'm too
tired to fight 
		any more.

And if both DOM and SAX had not provided access to comment nodes and
specifications like XSLT and XPath allow manipulation of these nodes, we
would have seen XML parsers left and right that did not support any standard
APIs. I consider that a worse scenario than the current situation.

The issue about why some features got into various W3C specifications is too
big for me to know. :-)

Khun Yee Fung

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at
Archived as: and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo at the following message;
unsubscribe xml-dev
To subscribe to the digests, mailto:majordomo at the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at

More information about the Xml-dev mailing list