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 (Scribe)
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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://927965]
help
Chatterbox?
[shmem]: perl -E '($what=FOOL & MONK)=~s/(.)$/ chr((ord$1)+12)/e; say $what'

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2017-07-24 17:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (356 votes). Check out past polls.