Also, while I see your point that the overall concept of DOM might be more sensible in theory than that of SAX, I found that it's just easier to get going with the SAX API than with DOM or even JDOM. You can get something working with very few lines of code, and good examples are all over the Web. SAX can be a pain to debug though.

Certainly not "more sensible" -- in fact, I've seen over and over again people who aren't comfortable with SAX implement things that involve reading enormous amounts of XML using DOM and then running out of memory. But they decompose the problem into "first, get everything in; then do something to everything" instead of "get one in, handle it, and discard it."


I read this awesome book called "Building Parsers in Java" a couple years ago

That sounds worth looking up...

But I appreciate your elaborating on commons digester. That's the one I was thinking of. I'll have to check that out. Also, I've never even looked at Spring. By the way, do you happen to know what type of parser either of those uses? Just curious.

Digester is a wrapper around SAX. Digester itself extends org.xml.sax.helpers.DefaultHandler And while the most common way people use Digester is to create a tree of objects, once you get inside it, you realize that you can do a lot more. You can write Digester rules that do the aforementioned "get one, handle it and discard it" as well as the more common rules which do "get one and add it to the tree".


Joe

--
Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com "Narrow minds are weapons made for mass destruction" -The Ex


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to