Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Adding Elements to XML

by Anonymous Monk
on Nov 21, 2012 at 12:27 UTC ( #1004908=note: print w/ replies, xml ) Need Help??


in reply to Adding Elements to XML

Also, generally speaking, use XPath expressions to navigate an XML structure, not hard code. The day will come when you have a structure to deal with that is not-quite what your code was hard-coded to expect. Therefore, as a general approach to this problem, use XPath to find the node(s) you want, then modify them.


Comment on Re: Adding Elements to XML
Re^2: Adding Elements to XML
by Anonymous Monk on Nov 21, 2012 at 13:27 UTC

    have a structure to deal with that is not-quite what your code was hard-coded to expect.

    hardcode an xpath or hardcode something else -- if it changes, your code will change, duh

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2014-07-12 09:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (239 votes), past polls