Fw: DOM vs. SAX??? Nah. (was RE: Storing Lots of Fiddly Bits (was Re: What is XML for?)

Walter Underwood wunder at infoseek.com
Thu Feb 11 17:39:16 GMT 1999


At 02:17 PM 2/11/99 +0200, Oren Ben-Kiki wrote:
>David Megginson <david at megginson.com> wrote:
>>
>>1. SAX and DOM are complementary
>
>
>IMVHO SAX should be defined not as a "parser interface" but as a "DOM tree
>visitor interface".

We use a fair amount of XML inside Infoseek, and were just having
this DOM vs. SAX discussion on Monday. There are applications that
really are interested in the document, and the DOM interface is a
tremendous help for those. For some other applications, the DOM is
a total waste of time -- they need to turn the contents of the
document into application data (maybe objects, maybe not), and
creating DOM objects for everything an unnecessary step that slows
things down and bloats code.

An example of the latter is the XML text extractor in the Ultraseek
Server search engine. It needs to convert the incoming XML document
to fieldname/textbuffer pairs so they can be further analyzed and 
inserted into the search index. The expat handlers are about 80 lines
of Python. Works great.

Other applications use XML in an RPC-like manner. Those parsers
need to behave like an RPC marshalling parser, oriented towards
translating into user structures/objects, not RPC- or XML-centered
objects.

We are using both SAX and DOM interfaces here. And C++ and Java
and Python.

But always editing the code with Emacs.

wunder

--
Walter R. Underwood
wunder at infoseek.com
wunder at best.com (home)
http://software.infoseek.com/cce/ (my product)
http://www.best.com/~wunder/
1-408-543-6946

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/ and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)




More information about the Xml-dev mailing list