[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] what lies between SAX and DOM ... [Re: parser models]
John Cowan wrote: > Simon St.Laurent scripsit: > > > My own MOE (http://moe.sourceforge.net) is an effort to blur the push > > model and the tree-based model, since MOE objects can listen to the > > events and build trees as desired. Perl and Python have libraries for > > this as well. > > I have just proposed on the xom-interest list an XMLFilter called Shemp :-) > which does the same general thing with SAX events and XOM trees. During a > startElement callback, Shemp's client can ask it to start creating a tree; > all SAX events are then consumed until (but not including) the matching > endElement callback, at which time the tree is available. hi, there are already such ultra lightweight XML trees. i have implemented XmlPullNode which is incremental document object model essentially blending streaming-and-forward-only (events) and represent-xml-in-memory (trees) approaches. using XmlPullNode you can start accessing XML tree _before_ XML input is fully available (as soon as you try to read anything that is not available tree node is expanded by pulling more input). there are basically two ways to use XmlPullNode: you can ignore that it is constructed on demand and use it as any other "DOM" or you can actually access underlying xml pull parser and read input directly (to avoid construction of node tree for parts of input). parts of tree that are no longer needed can be removed and it helps to parse even huge inputs in small memory footprint. XmlPullNode is part of XPP2 - a bit old and mostly deprecated by XPP3 and XmlPull API but it is still working just fine (and is well tested). now i am working on on new version that will be part of XPP3 and will have more user friendly API: XPP2 version is efficient but is no toot good about forgiving or catching user errors ... approaches like XmlPullNode have obvious advantages of giving full navigation and still maintaining efficient resource utilization but i still wonder if anything better than incremental XML tree can be used that is between SAX and DOM: as easy to navigate as DOM and as fast and low on memory as SAX ... thanks, alek
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|