Re: [xml] sax + startElement

[Re Cc'ing the list since the informations may be useful for others and worth
 archiving, Daniel]

On Fri, Feb 09, 2007 at 05:46:07PM +0100, Jovan Kostovski wrote:
On 2/9/07, Daniel Veillard <veillard redhat com> wrote:
 I would suggest to avoid SAX unless you have critical performance
requirements, it will make your code 10 times easier to maintain if
you use the reader instead:

That's the reason why I tried usung SAX. I have to write a parser that will
work on embedded computer. It has a 200 MHz CPU with 128MB RAM
but there will be some big configuration files in (xml format) to handle.
The compiled code size matters too.
I saw from the examples that XMLReader is much more cleaner and easier
to use, but what are the system resouces needed comparing to SAX.
Since XMLReader is an interface to SAX2 it needs more memory, right?

  Perfectly right, that one of the few use case where using SAX makes sense,
I would still try to use SAX version 2 though it's a bit more complex, the
parser is faster, does more (namespace handling), and requires less allocation
at run time.
  The main change are Element start and end callbacks, see
you need a special magic version in SAX

see for example 
    static xmlSAXHandler debugSAX2HandlerStruct 
in testSAX.c in the source distribution,


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]