David Megginson ak117 at
Mon Dec 29 12:04:15 GMT 1997

Matthew Gertner writes:

 > Please correct me if I am wrong, but couldn't the phases in the
 > "life" of an XML document be summed as follows:
 >  Text -> Events -> Grove There is no point that I can see in going
 >  from a tree-based view
 > back to an event stream. The event stream is merely an evolution on
 > the path from text to a grove. Furthermoe, nothing I have seen in
 > the SAX proposal looks anything remotely like a simplified DOM. We
 > are talking about two complete different concepts here.

An event-based call-back interface would be useful for automatic
traversal of a DOM tree (rather than iterating through an
enumeration), but the callbacks should then take DOM nodes as

Personally, I believe that an event-based interface is almost always
more difficult to use and understand than a tree-based interface -- it
requires the user to manage stacks and allocate objects herself.  On
the other hand, for advanced programmers, and event-based interface
has important advantages:

- it allows linear processing of very large documents with very little

- it can save the waste of building two separate trees, when the user
  needs to build a different kind of tree from the XML document

For me, then, the advantage of a common interface was not to help
naive coders, but to provide a standardised low-level access to XML
documents; to strain an analogy, SAX-J would be the IP to the DOM's

All the best,


David Megginson                 ak117 at
Microstar Software Ltd.         dmeggins at

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at
Archived as:
To (un)subscribe, mailto:majordomo at the following message;
(un)subscribe 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