Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Perl - Modify the nested XML tags

by choroba (Canon)
on Jan 11, 2013 at 23:32 UTC ( #1012995=note: print w/ replies, xml ) Need Help??


in reply to Perl - Modify the nested XML tags

There is how I would do it using XML::XSH2, a wrapper around XML::LibXML:

open 1.xml ; rename Feed response ; cd Feed ; rename Products result ; cd Products ; rename Product doc ; cd Product ; rename Description str[@name="body"] ; rename ExternalId int[@name="is_park_id"] ; rename ImageUrl str[@name="ss_image_thumb_small"] ; rename Name str[@name="title"] ; insert text "PF" prepend ExternalId ; delete //*/@* ; save :b ;
لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ


Comment on Re: Perl - Modify the nested XML tags
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2015-07-30 11:04 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 (271 votes), past polls