hi i was wondering how to get all the values between a specifed tag eg, <address>
<?xml version="1.0"?> <skin> <mainmenu> <address> <image>address.bmp</image> <x1>7</x1> <x2>7</x2> <x3>7</x3> <x4>7</x4> </address> <route> <image>route.bmp</image> <x1>7</x1> <x2>7</x2> <x3>7</x3> <x4>7</x4> </route> </mainmenu> </skin>
By "values" do you mean "all elements and text nodes contained in the element named 'address'?"
The main tinyxml test program shows lots of examples.
This doc shows how to do a full recursive traversal, dumping the DOM to stdout:
http://software.ellerton.net/tinyxml.html#dump-structure-of-a-document-to-stdout
Basically you're after something like:
for ( pChild = pParent->FirstChild(); pChild != 0; pChild = pChild->NextSibling()) { do_something_with_node_possibly_recursively( pChild ); }
HTH
Log in to post a comment.
hi i was wondering how to get all the values between a specifed tag
eg, <address>
<?xml version="1.0"?>
<skin>
<mainmenu>
<address>
<image>address.bmp</image>
<x1>7</x1>
<x2>7</x2>
<x3>7</x3>
<x4>7</x4>
</address>
<route>
<image>route.bmp</image>
<x1>7</x1>
<x2>7</x2>
<x3>7</x3>
<x4>7</x4>
</route>
</mainmenu>
</skin>
By "values" do you mean "all elements and text nodes contained in the element named 'address'?"
The main tinyxml test program shows lots of examples.
This doc shows how to do a full recursive traversal, dumping the DOM to stdout:
http://software.ellerton.net/tinyxml.html#dump-structure-of-a-document-to-stdout
Basically you're after something like:
for ( pChild = pParent->FirstChild(); pChild != 0; pChild = pChild->NextSibling())
{
do_something_with_node_possibly_recursively( pChild );
}
HTH