Re: [xml] Trying to use SAX

On Mon, Jan 09, 2006 at 08:53:20PM -0500, Allen, Jack wrote:
        I am trying to use the SAX API.

  try to avoid it ! Use the xmlReader if you have a choice.

I have setup the xmlSAXHandler
to callback my functions. The startDocument one works fine. But before
it calls my startElement function it takes a memory access error.
Running my program with gdb the backtrace looks like:

  is that a sax V2 handler ? 

Starting program: /home/jca/xml/event event.xml 

  Works fine here:

paphio:~/XML -> cat tst.xml
<?xml version="1.0"?>
        <action>menu selection</action>

paphio:~/XML -> ./testSAX --sax2 tst.xml
SAX.startElementNs(event, NULL, NULL, 0, 0, 0)
        , 9)
SAX.startElementNs(number, NULL, NULL, 0, 0, 0)
SAX.characters(1, 1)
SAX.endElementNs(number, NULL, NULL)
        , 9)
SAX.startElementNs(date, NULL, NULL, 0, 0, 0)
SAX.characters(01-01-2006, 10)
SAX.endElementNs(date, NULL, NULL)
        , 9)
SAX.startElementNs(time, NULL, NULL, 0, 0, 0)
SAX.characters(18:01:02, 8)
SAX.endElementNs(time, NULL, NULL)
        , 9)
SAX.startElementNs(action, NULL, NULL, 0, 0, 0)
SAX.characters(menu selection, 14)
SAX.endElementNs(action, NULL, NULL)
, 1)
SAX.endElementNs(event, NULL, NULL)

  Probably an error building the SAX handler or in the callbacks. Use the
xmlReader or the existing testSAX.c code as a guidance. Remember we can't 
debug your code.


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