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

Re: XML::Twig removing tags from content

by choroba (Canon)
on Sep 27, 2011 at 13:37 UTC ( #928087=note: print w/ replies, xml ) Need Help??


in reply to XML::Twig removing tags from content

I usually use XML::XSH2 for XML manipulation. For a task like yours, I'd use something like

for //li/* mv text() replace . ;
Update: Ouch, this works better:
for //li/* { xmove (text()|*) after . ; rm . ; }
or, even shorter:
for //li/* xmove (text()|*) replace . ;


Comment on Re: XML::Twig removing tags from content
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (9)
As of 2015-07-31 01:36 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 (274 votes), past polls