Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Replacing XML Tag name with another

by choroba (Canon)
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 having an uproarious good time at the Monastery: (6)
As of 2015-07-29 01:39 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 (260 votes), past polls