Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   XML (http://www.velocityreviews.com/forums/f32-xml.html)
-   -   Xerces C++ and DOM trees (http://www.velocityreviews.com/forums/t168531-xerces-c-and-dom-trees.html)

Peter Saffrey 01-06-2005 03:01 PM

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 01-06-2005 03:21 PM

Re: Xerces C++ and DOM trees
 


Peter Saffrey wrote:


> 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?


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/


All times are GMT. The time now is 04:50 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.