Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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?
marto waves
[Discipulus]: if you prepend 'good' to this mere part of the day you get a wish..as in good morning LanX
[LanX]: good
[LanX]: ;-p
[Eily]: good mere part of the day to you too
[karlgoethebier]: good #metoo

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (12)
As of 2018-02-20 10:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (268 votes). Check out past polls.

    Notices?