Xerces C++ and DOM trees

Discussion in 'XML' started by Peter Saffrey, Jan 6, 2005.

  1. I am hoping to use the Xerces libraries to read and process XML files
    for my applications. What I want is to parse some XML and extract
    information from particular tags, something which should be fairly
    standard.

    Using the examples from the API documentation
    (http://xml.apache.org/xerces-c/program-dom.html#XercesDOMParser) I
    have something which compiles and parses (as far as I can tell -
    there's no output) but I can't find anything in the documentation
    which tells me how to search or print the constructed object. What are
    the methods to do this? Can somebody point me at the right section of
    documentation?

    The examples in the "samples" directory of the xerces release are all
    rather verbose - the DOMCount example is several thousand lines for a
    simple task, but to handle a wide variety of exceptional cases. What I
    want is a hundred line example that parses a vanilla XML file searches
    for a named tag and outputs the value in that tag, letting me add
    extra complexity later - any idea where I can find such an example?

    Thanks,

    Peter
    Peter Saffrey, Jan 6, 2005
    #1
    1. Advertising

  2. Peter Saffrey wrote:


    > Using the examples from the API documentation
    > (http://xml.apache.org/xerces-c/program-dom.html#XercesDOMParser) I
    > have something which compiles and parses (as far as I can tell -
    > there's no output) but I can't find anything in the documentation
    > which tells me how to search or print the constructed object. What are
    > the methods to do this? Can somebody point me at the right section of
    > documentation?


    It is W3C DOM so at least "searching" is possible with methods like
    getElementsByTagName and getElementsByTagNameNS of nodes.
    <http://xml.apache.org/xerces-c/ApacheDOMC++BindingL2.html#A:%20Document%20Object%20Model:%20Core>

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Jan 6, 2005
    #2
    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. Helen
    Replies:
    0
    Views:
    808
    Helen
    Mar 2, 2004
  2. cvissy
    Replies:
    0
    Views:
    600
    cvissy
    Nov 16, 2004
  3. bugbear
    Replies:
    5
    Views:
    573
  4. nikki

    DBXML and the Xerces DOM

    nikki, Jul 12, 2007, in forum: Python
    Replies:
    0
    Views:
    250
    nikki
    Jul 12, 2007
  5. jacob navia

    Binary search trees (AVL trees)

    jacob navia, Jan 3, 2010, in forum: C Programming
    Replies:
    34
    Views:
    1,385
    Dann Corbit
    Jan 8, 2010
Loading...

Share This Page