Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

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

by bitingduck (Chaplain)
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
Replies are listed 'Best First'.
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 avoiding work at the Monastery: (11)
As of 2015-07-28 09:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (254 votes), past polls