Does XML::LibXML::Node replaceNode() replace Perl instances of the replaced node -
... after replace a
b
, previous references a
point b
?
#!/usr/bin/perl use warnings; use strict; use xml::libxml; $dom = 'xml::libxml'->load_xml(string => '<r><p><c/></p></r>'); ($n1) = $dom->findnodes('/r/p/c'); ($n2) = $dom->findnodes('/r/p/c'); $n1->replacenode('xml::libxml::element'->new('n')); print $dom; print $n1, $n2;
output:
<?xml version="1.0"?> <r><p><n/></p></r> <c/><c/>
Comments
Post a Comment