Help with SAX parsing

Discussion in 'XML' started by uestebanez@confluencia.net, Aug 29, 2005.

  1. Guest

    Hi everybody!
    I have a little problem working with libxml SAX API.
    The problem is that I don't know how to stop parsing when I have
    processed the data I need. I don't want to parse all file, I only need
    read until I reach certain part of the xml and then stop parsing.
    Does anybody know how to stop?

    Another question is, Is necessary free any memory when I am using SAX
    API?
    I only call to "xmlSAXUserParseFile" and then callbacks "call me" so I
    store the values in my own data structures and I never release
    "nothing". Is this right?

    Thanks to all.

    PS: I would be very nice if some of you can tell me a good SAX API
    tutorial.
    , Aug 29, 2005
    #1
    1. Advertising

  2. wrote:

    > I have a little problem working with libxml SAX API.
    > The problem is that I don't know how to stop parsing when I have
    > processed the data I need. I don't want to parse all file, I only need
    > read until I reach certain part of the xml and then stop parsing.
    > Does anybody know how to stop?


    I don't know about libxml and C but with SAX2 in Java your handlers need
    to throw an error to force the parser to abort parsing.

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Aug 29, 2005
    #2
    1. Advertising

  3. Guest

    Thanks Martin,
    But I'm afraid that exceptions doesn't exists in C (not C++) and this
    is the languague tha I'm using. :-(
    Regards,
    Unai
    , Aug 29, 2005
    #3
  4. wrote:

    > But I'm afraid that exceptions doesn't exists in C (not C++) and this
    > is the languague tha I'm using. :-(


    Right, maybe there is a way with that libxml SAX API and C to have the
    handler indicate an error but I can't help with that stuff. You could
    try the mailing list
    <http://mail.gnome.org/mailman/listinfo/xml>
    for libxml.

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Aug 29, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Khalid Rasheed

    Parsing XML using SAX

    Khalid Rasheed, Dec 18, 2003, in forum: Java
    Replies:
    1
    Views:
    338
    Christophe Vanfleteren
    Dec 18, 2003
  2. Replies:
    5
    Views:
    2,660
    srivvivek
    Jan 12, 2009
  3. Jonathan
    Replies:
    0
    Views:
    396
    Jonathan
    Oct 28, 2003
  4. Naren
    Replies:
    0
    Views:
    571
    Naren
    May 11, 2004
  5. Aleksandar Matijaca
    Replies:
    5
    Views:
    2,311
    Aleksandar Matijaca
    Sep 1, 2004
Loading...

Share This Page