Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

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

by bitingduck (Chaplain)
on Nov 03, 2012 at 01:12 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1002065]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-04-25 19:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found