You could walk the document nodes using a xerces::DOMTreeWalker and its functions...

::nextSibling()
::firstChild()
::nextChild()
::parentNode()

Each of these returns a xerces::DOMNode pointer and you can use its functions (e.g., ::getNodeValue()) to extract the node data.

Since your document conforms to a schema, you know how the nodes are ordered and nested.


Rackl, Robert G wrote:
Attached is a sample XML file from which I need to extract data. I am
using the DOM document approach, learning from the DOMCount sample code.
I am able to extract the data from the "Identification", "Grid",
"Solution", and "Results" nodes. I am also able to list the Names of the
three nodes called "Panel" using the getElementsByTagName method from
the document root. Where I am running into trouble is extracting the
attribute data for each element called "Node" [sorry about the use of
"Node" here for the corners of an aircraft fuselage panel] for a
particular Panel. What should be the approach here, please? (I tried
using getElementsByTagName from a "Panel" node - did not work; I tried
descending down the subtree using child nodes - could not make it work;
I thought about using filters - did not know where/how to start). Can
you point me to sample code for the approach you would recommend,
please?

  -_r4_\.
___`o-#^o`__

Reply via email to