Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
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?
[Tux]: choroba++ # pm_cb_g also signals replies to posts, something#cbstream does not
[marto]: good afternoon all
[marto]: that is a neat feature, I'll have to have a look at how it displays that
[Tux]: 14:32 Europe/Amsterdam, so good afternoon to you :)
[marto]: 13:32, sunny Glasgow :P
[Tux]: as in, some others might appreciate a good morning or goor evening
[Tux]: Glasgow, as in TPCiG-2018 !!!! :) :)
erix would rather appreciate proof of a goodmorning
[marto]: Tux so I'm told :)

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (11)
As of 2017-09-22 12:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (262 votes). Check out past polls.

    Notices?