I have some boost::property_tree::ptree
. I need tree with removing some elements with certain tag name. For example, xml for source ptree
is the following:
<?xml version="1.0" encoding="utf-8"?>
<document>
<B atr="one" atr1="something">
<to_remove attr="two">10</to_remove>
</B>
<to_remove>
<C>value</C>
<D>other value</D>
</to_remove>
<E>nothing</E>
</document>
And I'd like to get ptree
with xml like the following:
<?xml version="1.0" encoding="utf-8"?>
<document>
<B atr="one" atr1="something" />
<E>nothing</E>
</document>
How to write function, that generate new ptree
with removed <to_remove>
nodes?