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

Re: Swapping xml elements from an external file?

by Fletch (Bishop)
on Oct 06, 2008 at 22:02 UTC ( [id://715656]=note: print w/replies, xml ) Need Help??


in reply to Swapping xml elements from an external file?

Kludgy, but as the problem's presented (and presuming there's a 1-to-1 mapping from original head elements to marked up head elements):

  • Create a hash mapping from original to extra-crispymarkup head elements (presuming they're small just treat them as two text files and read them line-by-line in parallel)
  • Parse the original file and use XML::Twig to walk all the head elements, replacing the contents by looking up the original value in your hash and retrieving the possibly modified version
  • Profit!

The cake is a lie.
The cake is a lie.
The cake is a lie.

  • Comment on Re: Swapping xml elements from an external file?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2024-04-23 15:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found