I load a boost::property_tree::ptree from an XML-file, that looks somewhat like this:
<bla>
<foo>
<element id="1" type="..." path="..."/>
<element id="2" type="..." path="..."/>
<element id="3" type="..." path="..."/>
<otherelement/>
</foo>
</bla>
I load that into a property-tree with read_xml. Now I want to build a vector containing structs, that resemble the element
-tags. I can do the following:
BOOST_FOREACH(ptree::value_type& node, tree.get_child("bla.foo"))
{
if (node.first == "element")
{
...
}
}
So far it's good, but I have problems to get the data in the element. node.second
should contain that, but how do I access it properly? node.second.get("xmlattr.type")
don't work.