Xerces C++ and DOM trees

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Peter Saffrey

    Xerces C++ and DOM trees

    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/progr...ercesDOMParser) 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
  • Martin Honnen

    #2
    Re: Xerces C++ and DOM trees



    Peter Saffrey wrote:

    [color=blue]
    > Using the examples from the API documentation
    > (http://xml.apache.org/xerces-c/progr...ercesDOMParser) 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?[/color]

    It is W3C DOM so at least "searching" is possible with methods like
    getElementsByTa gName and getElementsByTa gNameNS of nodes.
    <http://xml.apache.org/xerces-c/ApacheDOMC++Bin dingL2.html#A:% 20Document%20Ob ject%20Model:%2 0Core>

    --

    Martin Honnen

    Comment

    Working...