Re: [xml] TextReader vis-a-vis SAX



On Wed, Aug 29, 2007 at 06:24:35PM +0530, harbhanu wrote:
Always created, but it's mutating
To what extent a doc is generated, is it till the next event (terminal
state)?

  I don't understand the question.
What libxml2 creates is a sliding window over the full document. It
contains the current node and its ancestors. That's the only garantee
by default (but then there are APIs to increase those, see the documentation)
   http://xmlsoft.org/xmlreader.html


Can it be done on the stream also, like the one expected from API
xmlSchemaValidateStream ?
 Always created.
[..] ??

So, on an average for a complete document parsing what is the expected
performance ratio between reader and Sax ?

  Reader is a bit slower. But you can't compare the two, they are not at the
same level. One thing is sure, if you have nasty problems with SAX (like
entities support) you're mostly on your own, while with the Reader I can
usually fix things (as I control what happens a lot more).
  Both API don't make much sense just on their own. You have to do something
else on top, and only then it might make sense to compare the two.

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]