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

  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)

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.


Red Hat Virtualization group
Daniel Veillard      | virtualization library
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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