Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^3: XML::Twig removing tags from content (XML::Twig)

by slugger415 (Beadle)
on Sep 26, 2011 at 22:27 UTC ( #927965=note: print w/ replies, xml ) Need Help??


in reply to Re^2: XML::Twig removing tags from content (XML::Twig)
in thread XML::Twig removing tags from content

To answer my own question, using reverse seems to fix the problem:

for my $p ($elt->children('p')) { for my $c (reverse($p->cut_children())) { $c->paste($elt); } $p->delete(); }

I don't understand why it's needed, but it works.


Comment on Re^3: XML::Twig removing tags from content (XML::Twig)
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (15)
As of 2014-09-30 19:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (381 votes), past polls