Re: [xml] Question on SAX

On Mon, Sep 03, 2001 at 11:07:04PM -0700, Bill Moseley wrote:

I'm a bit confused by a comment in the docs.  I'm planning on using a push
interface with SAX for both xml and html docs.

At the docs say:

"Note also that the push interface can be limited to SAX: just use the two
first arguments of xmlCreatePushParserCtxt()."

From testSAX.c and from the parser docs it looks like
xmlCreatePushParserCtxt() wants a few characters to start off with.  So is

  Not necessary in most case it's used to consume and decode the first
bytes to find the encoding. Read the XML specification appendice on
finding encodings you will understand.

that quote above still valid and if so what needs to be passed?  (I guess
I'm missing some point -- is a push parser always SAX?

  No as that sentence says.

- and avoids the
memory overhead of a DOM tree?)

  Using SAX won't build the DOM tree. The DOM tree is built internally
on top of SAX as explained in the doc.

I'm also unclear what the filename parameter is used for in
(xml|html)CreatePushParserCtxt().  It says "The value of filename is used
for fetching external entities and error/warning reports."  Is there more
documentation on this some place.

  RFC 2396, and basically everything which may require the name/address of
the flow of data you're passing to the parser, this includes resolving
URI-References embedded in the stream and needed by the parser or other


Daniel Veillard      | Red Hat Network
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]