Beefy Boxes and Bandwidth Generously Provided by pair Networks chromatic writing perl on a camel
No such thing as a small change
 
PerlMonks  

Re: Replacing XML Tag name with another

by choroba (Abbot)
on Sep 27, 2011 at 12:45 UTC ( #928079=note: print w/ replies, xml ) Need Help??


in reply to Replacing XML Tag name with another

I usually use XML::XSH2:

open file ; rename Heading_1 /root/H1 ; rename Heading_2 /root/H2 ; save :b ;
Or, more elaborate:
rename :i { s/h/Heading_/ } /root/*[xsh:match(name(),'H[12]')] ;
Note that I use an underscore instead of a space, see mirod's Re: Replacing XML Tag name with another.


Comment on Re: Replacing XML Tag name with another
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2014-04-18 03:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (461 votes), past polls