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



On Wed, Aug 29, 2007 at 04:34:46PM +0530, harbhanu wrote:

   Hi,

   I  am  trying  to  understand the set of advantages that XmlTextReader
   offers in comparison to SAX and have

   some queries regarding the same, they are as..

       1> Reader carries a doc pointer in its structure... _xmlTextReader

   xmlDocPtr                doc;    /* when walking an existing doc */

   In what all cases this document is created from the xml document being
   parsed? Is it only created if I invoke "xmlTextReaderExpand" ?

  Always created, but it's mutating. You don't have the right to keep
pointers within that tree when progressing during parse.


   2> Is the document (tree) generated for schema validation (XML Schema)
   using reader? Can it be done on the stream also, like the one expected
   from API xmlSchemaValidateStream ?


  Always created.

   3>  To  what  extent  entities supported in reader? Can I use external
   entities also along with reader?

  yes full support.

        4>  How is error reported incase of parsing failure using reader?
   Is  is  redirected  using  the  error handlers registered (Generic and
   structured error handlers)?

  yes and the Reader operation will then fail after any fatal error.

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]