Re: XML parsers
Aleksander Slominski <[email protected]> Sun, 20 Mar 2005 15:35:15 -0500
| Newsgroups | gmane.text.xml.xmlpull.devel |
|---|---|
| Message-ID | <[email protected]> |
--------------000603070201020706030802 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit hi Vidar, having streaming parser (needs *constant* amount of memory that is independent from size of input) or tree-oriented access (that reads whole input into XML) is the most important difference.. push (SAX), pull/cursor (XmlPull, StAX etc), tree (DOM, DOM4J, XB1, XOM, ...) , partial tree (streaming tree: XPP2, AXIOM, etc), and other hybrids are just APIs and *you can get any API on top of tree-oriented* representation of XML but only some APIs can be used with streaming (as you can only access small window of XML content) - there are possible some adaptation but streaming implies that XML events processed are discarded so it is not possible to access already processed XML - this is both an advantage (low memory!) and a disadvantage (if you need to access and process whole XML tree many times). see also diagram at the end of this paper i wrote that shows where different APIs fit: http://www.xmlpull.org/history/ HTH, alek Vidar Martinsen wrote: >Hello! > >I am a student in Oslo, Norway, I am currently doing a Masters in IT, I am >doing a research paper on XML parsing on resource limited devices. First I >want to thank you for much interesting reading on your website and on >www.xmlpull.org. A lot of helpful material there, at the moment I am a bit >confused about the different types of parsers. > >You argue that there are two types of parsers: >Streaming parsers with two main subtypes >push -SAX >pull -XPP/StAX etc > >Tree oriented models >JDOM/DOM etc > >I was reading this article on >xml.com - http://www.xml.com/lpt/a/2003/07/09/xmlapis.html > >And the take home message from that was that there also are two types; >Streaming and In-memory >Streaming -> push and pull >In-memory -> Cursor and Tree oriented > >The article mentioned argues that cursor parsers is a subtype of the >In-memory because you can traverse, access randomly and is not read-only. >But as far as I understand you mean that cursor parsers is just a subtype >of pull parsers leaving me somewhat confused :) > >Is this just a differenet spin around the same topic? Or has the author a >different idea of what a pull parser is than you have? To my understanding >your XPP is much more than what a basic pull parser. So it might be a more >historic view the author is presenting in his article. Hope you can help >me. > >Regards Vidar Martinsen > > > -- The best way to predict the future is to invent it - Alan Kay --------------000603070201020706030802 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> </head> <body bgcolor="#ffffff" text="#000000"> hi Vidar,<br> <br> having streaming parser (needs *constant* amount of memory that is independent from size of input) or tree-oriented access (that reads whole input into XML) is the most important difference..<br> <br> push (SAX), pull/cursor (XmlPull, StAX etc), tree (DOM, DOM4J, XB1, XOM, ...) , partial tree (streaming tree: XPP2, AXIOM, etc), and other hybrids are just APIs and <b>you can get any API on top of tree-oriented</b> representation of XML but only some APIs can be used with streaming (as you can only access small window of XML content) - there are possible some adaptation but streaming implies that XML events processed are discarded so it is not possible to access already processed XML - this is both an advantage (low memory!) and a disadvantage (if you need to access and process whole XML tree many times).<br> <br> see also diagram at the end of this paper i wrote that shows where different APIs fit:<br> <a class="moz-txt-link-freetext" href="http://www.xmlpull.org/history/">http://www.xmlpull.org/history/</a><br> <br> HTH,<br> <br> alek<br> <br> Vidar Martinsen wrote: <blockquote cite="[email protected]" type="cite"> <pre wrap="">Hello! I am a student in Oslo, Norway, I am currently doing a Masters in IT, I am doing a research paper on XML parsing on resource limited devices. First I want to thank you for much interesting reading on your website and on <a class="moz-txt-link-abbreviated" href="http://www.xmlpull.org">www.xmlpull.org</a>. A lot of helpful material there, at the moment I am a bit confused about the different types of parsers. You argue that there are two types of parsers: Streaming parsers with two main subtypes push -SAX pull -XPP/StAX etc Tree oriented models JDOM/DOM etc I was reading this article on xml.com - <a class="moz-txt-link-freetext" href="http://www.xml.com/lpt/a/2003/07/09/xmlapis.html">http://www.xml.com/lpt/a/2003/07/09/xmlapis.html</a> And the take home message from that was that there also are two types; Streaming and In-memory Streaming -> push and pull In-memory -> Cursor and Tree oriented The article mentioned argues that cursor parsers is a subtype of the In-memory because you can traverse, access randomly and is not read-only. But as far as I understand you mean that cursor parsers is just a subtype of pull parsers leaving me somewhat confused :) Is this just a differenet spin around the same topic? Or has the author a different idea of what a pull parser is than you have? To my understanding your XPP is much more than what a basic pull parser. So it might be a more historic view the author is presenting in his article. Hope you can help me. Regards Vidar Martinsen </pre> </blockquote> <br> <br> <pre class="moz-signature" cols="103">-- The best way to predict the future is to invent it - Alan Kay </pre> <br> <!-- |**|begin egp html banner|**| --> <br> <tt><hr width="500"> <b>Yahoo! Groups Links</b><br> <ul> <li>To visit your group on the web, go to:<br><a href="http://groups.yahoo.com/group/xmlpull-dev/">http://groups.yahoo.com/group/xmlpull-dev/</a><br> <li>To unsubscribe from this group, send an email to:<br><a href="mailto:[email protected]?subject=Unsubscribe">[email protected]</a><br> <li>Your use of Yahoo! Groups is subject to the <a href="http://docs.yahoo.com/info/terms/">Yahoo! Terms of Service</a>. </ul> </tt> </br> <!-- |**|end egp html banner|**| --> </body> </html> --------------000603070201020706030802--