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

Popular posts from this blog

c# SetCompatibleTextRenderingDefault must be called before the first -

c++ - Fill runtime data at compile time with templates -

C#.NET Oracle.ManagedDataAccess ConfigSchema.xsd -