senjuhashirama / pugixml

Automatically exported from code.google.com/p/pugixml
0 stars 0 forks source link

Accessing data within a node #184

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi !

I have a XML file that includes :

...
    <pitch>
     <step>C</step>
     <octave>5</octave>
    </pitch>

How can I access to "step" and "octave" information ? 

Original issue reported on code.google.com by fmichel....@gmail.com on 12 Oct 2012 at 9:23

GoogleCodeExporter commented 9 years ago
I found it using child_value()

Original comment by fmichel....@gmail.com on 12 Oct 2012 at 11:08

GoogleCodeExporter commented 9 years ago
To make the answer more complete, here is the child_value documentation:

http://pugixml.googlecode.com/svn/tags/latest/docs/manual/access.html#manual.acc
ess.nodedata

And here is an alternative way (new in pugixml 1.2) to work with text inside 
nodes:

http://pugixml.googlecode.com/svn/tags/latest/docs/manual/access.html#manual.acc
ess.text

Original comment by arseny.k...@gmail.com on 12 Oct 2012 at 4:24