Content-Type: | text/plain |
Content-Disposition: | inline |
Content-Transfer-Encoding: | binary |
MIME-Version: | 1.0 |
X-Mailer: | MIME-tools 5.411 (Entity 5.404) |
Subject: | failed ->setNodeName with non-prefix on namespace mode. |
X-RT-Original-Encoding: | iso-8859-1 |
Content-Length: | 735 |
if processing namespaced node with XML::LibXML-1.58,
we can't use ->setNodeName without namespace prefix.
such as follows:
$ perl -MXML::LibXML <<'END'
Show quoted text
> my $parser = XML::LibXML->new;
> my $fragment = $parser->parse_balanced_chunk("<foo xmlns='http://www.w3.org/2000/xmlns/' />\n");
> print "before : " . $fragment->serialize;
> $fragment->firstChild->setNodeName('bar');
> print "setname w/o ns : " . $fragment->serialize;
> $fragment->firstChild->setNodeName('not-found-ns:bar');
> print "setname with ns: " .$fragment->serialize;
> END
before : <foo xmlns="http://www.w3.org/2000/xmlns/"/>
setname w/o ns : <foo xmlns="http://www.w3.org/2000/xmlns/"/>
setname with ns: <bar xmlns="http://www.w3.org/2000/xmlns/"/>