Maxim has asked for the wisdom of the Perl Monks concerning the following question:
use XML::LibXML; use strict; my $file = (<DATA Or filename>); my $d = XML::LibXML->new->parse_string(join "", $file); for my $dead ($d->findnodes(q{/opt/node[val = "2"]})) { $dead->unbindNode; } print $d->toString; Data____ <?xml version="1.0"?> <opt> <node> <val>1</val> </node> <node> <val>2</val> </node> <node> <val>3</val> </node> </opt>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Start tag expected
by ikegami (Patriarch) on Oct 10, 2004 at 06:06 UTC | |
|
Re: Start tag expected
by chromatic (Archbishop) on Oct 10, 2004 at 06:09 UTC | |
|
Re: Start tag expected
by Maxim (Sexton) on Oct 10, 2004 at 06:40 UTC | |
|
Re: Start tag expected
by pg (Canon) on Oct 10, 2004 at 06:51 UTC |