Scott Sauyet wrote:
> I do understand the differences in strengths of DOM and SAX.  I'm
> still trying to imagine a case in which I would want to do both for
> the same document.  Can you suggest such a case?

And I shoudl have said that I was looking for a case in which I would
want to use both SAX and DOM techniques on the same document in the
same program.  Obviously, different programs might need to do very
different things with the document, and might choose different
techniques.

I'm curious because some years ago, I was working with a mostly-COBOL
team that needed to work with XML.  The skeptics thought that XML was
going to be terribly bloated compared to their VSAM files (it actually
turned out to be significantly smaller), and they were looking for any
reason to reject using XML at all.  They almost got their wish when
they used the IBM COBOL XML parser that came with that mainframe OS.
This parser was simply too slow to meet their requirements, and this
was a big blow against XML.  I did some investigating and realized
that this parser combined the worst features of SAX and DOM:  it
supplied only a sequence of events instead of random access, but had
to load the whole document into memory to do so!  I was able to write
a SAX-like parser in a few days and we did end up using XML.  But it
made me very wary of ever combining SAX- and DOM-style interfaces in a
single program.  I have never seen any application which would be
improved by doing both.

  -- Scott

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/[email protected]/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/[email protected]/

To unsubscribe from this group, send email to
[email protected]

Reply via email to