Visualizing XML children in Python using ElementTree? -


given xml:

<anthology>     <price></price>     <book>         <price></price>         <leaflet>             <title>war</title>             <price>20</price>         </leaflet>         <leaflet>             <title>peace</title>             <price>30</price>         </leaflet>     </book>     <book>         <price>60</price>     </book> </anthology> 

i update 'price' tags in hierarchical manner , print:

anthology price: 110, book 1 price: 50, book 2 price: 60

or in pseudo speak, search index item , have 'price' tag reflect sum of children 'price' tags.

any suggestions how attack using elementtree?


Comments

Popular posts from this blog

hibernate - How to load global settings frequently used in application in Java -

python 3.x - Mapping specific letters onto a list of words -

objective c - Ownership modifiers with manual reference counting -