[
Lists Home |
Date Index |
Thread Index
]
At 09:48 AM 7/10/2003 -0400, Elliotte Rusty Harold wrote:
>There are limits. This won't help if you really do need to have the entire
>document in memory at once, or if you need to move about randomly in the
>tree. However, if you can work with a peephole view of the document
>stream, then XOM gives you a larger peephole than SAX. It can show you
>whole elements of your choice rather than individual tokens. I've found
>this approach to be shockingly useful for many applications. In many cases
>elements are the right granularity for processing a document. DOM's
>document level view is too large. SAX's token level view is too small.
>XOM's element level view is just right. :-)
Similarly, in Markup Object Events (MOE), you get the document reported as
events. If you want to build a tree, you just feed subsequent events to
the root event for the tree, and the tools build the tree and notify you
when it's ready. The listen() method is at the heart of this, and it's
pretty simple.
http://moe.sourceforge.net/docs/com/simonstl/moe/CoreComponentI.html#listen(com.simonstl.moe.CoreComponentI)
You can still build a huge memory-eating tree this way, but it offers a lot
of flexibility. I'm planning to return to MOE later this year, and I've
been tinkering quietly on it for a while, so it's certainly not fit for
production use at the moment. Now that I finally have a parser that can
feed it all the information it supports, it should be fun.
|