Parse XML with Boost access and populate property tree



I have XML file:


<expressions> <addition id="1"> <item>2</item> <item>3</item> <item>4</item> </addition> <subtraction id="2"> <minuend>3</minuend> <subtrahend>2</subtrahend> </subtraction> <multiplication id="3"> <factor>5</factor> <factor>6</factor> <factor>8</factor> </multiplication> <division id="4"> <dividend>54</dividend> <divisor>9</divisor> </division> </expressions>


Need to parse it and provide the result like another XML:


<expressions> <result id="1">9</result> <result id="2">1</result> <result id="3">240</result> <result id="4">6</result> </expressions> Currently I'm investigating the BOOST in area of ptree and read_xml Please advise where additional information could be found? Thanks in advance


No comments:

Post a Comment