in reply to XML::LibXML - How to extract an element including the elements within?
Output:my ($node) = $dom->findnodes('/doc/text'); my $string = $node->toString; print "toString:\n$string\n"; # remove enclosing tags $string =~ s/^<[^>]+>//; $string =~ s/<[^>]+>$//; print "toString:\n$string\n";
toString: <text>From mobile, <ph1 i="1" type="33" x="1"/>dial<ph2 i="1"/> this n +umber:</text> toString: From mobile, <ph1 i="1" type="33" x="1"/>dial<ph2 i="1"/> this number:
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: XML::LibXML - How to extract an element including the elements within?
by haukex (Archbishop) on May 09, 2019 at 20:46 UTC | |
by TravelAddict (Acolyte) on May 10, 2019 at 19:44 UTC | |
|
Re^2: XML::LibXML - How to extract an element including the elements within?
by TravelAddict (Acolyte) on May 10, 2019 at 19:37 UTC |