PerlingTheUK has asked for the wisdom of the Perl Monks concerning the following question:
sub remove_element { my $elem = shift; my @children = @{$elem->getChildNodes()}; if (@children == 0 ){ print $elem->toString; my $parent = $elem->getParentNode(); $parent->removeChild( $elem ); return; } for my $child ( @children ){ print $child->toString(); remove_element( $child ); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Crash on XML::DOM Remove Child
by rg0now (Chaplain) on Mar 09, 2005 at 00:27 UTC | |
by PerlingTheUK (Hermit) on Mar 09, 2005 at 10:31 UTC | |
by rg0now (Chaplain) on Mar 09, 2005 at 10:47 UTC |