Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^4: XML Parse Change a Value and Write Back

by bitingduck (Friar)
on Nov 03, 2012 at 01:12 UTC ( #1002065=note: print w/ replies, xml ) Need Help??


in reply to Re^3: XML Parse Change a Value and Write Back
in thread XML Parse Change a Value and Write Back

You might get by with XML::Treebuilder. You build a tree from the original XML, and use XML::Element to find where you want to insert new elements and insert them, then dump the tree back to a file with the appropriate pretty printing. If I have time later I'll try to post a simple example. It's not as simple as XML::Simple, but it's not as much to wade through as XML::LibXML.


Comment on Re^4: XML Parse Change a Value and Write Back
Re^5: XML Parse Change a Value and Write Back
by anshumangoyal (Scribe) on Nov 03, 2012 at 11:08 UTC
    Treebuilder is again good for parsing and writing the xml but its very difficult to find the node and modify a parameter value.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1002065]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2014-10-31 07:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (215 votes), past polls