build a hierarchical tree, without using DOM,schema, and sax using expat parser and c

Discussion in 'XML' started by pharioum@gmail.com, Nov 5, 2007.

  1. Guest

    I've been experimenting with the jclark's expat parser. I compiled it
    on
    linux, and it works just great. However, finding tags and data by
    implementing the callback functions in c language is cumbersome.
    Has anybody written code that uses the expat callback's in such a way
    as to
    build a hierarchical tree, without using DOM,schema, and sax, that can
    be traversed.My purpose, just enough to traverse branches and find
    leafs of a xml documents without using DOM, schema, and sax, and i
    also want help regarding how to convert a xml document to a
    hierachical tree which contains tags values. thanks
    , Nov 5, 2007
    #1
    1. Advertising

  2. Pavel Lepin Guest

    < > wrote in
    <>:
    > I've been experimenting with the jclark's expat parser. I
    > compiled it on
    > linux, and it works just great. However, finding tags and
    > data by implementing the callback functions in c language
    > is cumbersome. Has anybody written code that uses the
    > expat callback's in such a way as to
    > build a hierarchical tree, without using DOM,schema, and
    > sax, that can be traversed.


    You know, changing your From header from
    <> to <> and
    reposting the same question in a different wording for the
    fifth time in a week is a Bad Idea, because it Annoys
    Regulars, and is Not Working Anyway. You've already been
    told to Do Your Own Homework. Yet another clueless droid
    with a degree is the last thing this industry needs.

    <http://www.catb.org/~esr/faqs/smart-questions.html>

    --
    "I can't help but wonder if you... don't know a hell of a
    lot more about practically every subject than Solomon ever
    did."
    Pavel Lepin, Nov 5, 2007
    #2
    1. Advertising

  3. Re: build a hierarchical tree, without using DOM,schema, and saxusing expat parser and c

    wrote:
    > build a hierarchical tree, without using DOM,schema, and sax


    The usual approach is to use the SAX output as input to your
    tree-structure builder. If you really insist on bypassing SAX, you're
    out of the domain of standard APIs and into mucking with the internals
    of the parser, which is never a good thing to do unless you have very
    specific requirements that the standards can't handle.

    --
    Joe Kesselman / Beware the fury of a patient man. -- John Dryden
    Joseph Kesselman, Nov 5, 2007
    #3
    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.

Share This Page