The choice between SAX and DOM is partly one of simplicity vs speed/
compactness, and partly a matter of what sort of "consumption model"
you have.  If you're only going to scan through the XML once, and you
know what data you want, and it's pretty well formed (you know
precisely what order elements will be in, etc) then SAX is good.  If
you need to keep referring to the data, or you need to extract data
from documents that may be a bit disordered (with elements in varying
order, extraneous elements, etc) then DOM is a lot simpler.

But, yes, DOM does take up a fair amount of storage -- no hard numbers
but I'd guess easily 20-50 times the size of the XML file.

On Jul 12, 6:51 pm, Indicator Veritatis <[email protected]> wrote:
> SAX is faster than DOM. Easier too, if you don't mind viewing
> everything as event driven. Rumor has it there is something faster,
> but I am not convinced it is anything more than rumor. But do a Google
> search "xml parser sax dom faster" and see if you think Piccolo or
> NanoXML are worth checking out.
>
> I would stick with SAX though, until these newer ones have been
> reviewed and proven not to have major omissions and bugs. Besides: SAX
> and DOM are already in Android. If you choose one of the others, even
> Apache's Betwixt or Xerces, you will have to include it as an extra
> Jar in your build.
>
> On Jul 12, 12:30 pm, Siva <[email protected]> wrote:
>
> > Can anyone tell me the easy and fastest XML Parser?
>
> > I need guide/sample code...
>
> > please help me...

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to