XML::LibXML namespaces after node removal
by Dominic Mitchell other posts by this author
Sep 2 2005 1:09AM messages near this date
view in the new Beta List Site
Re: Out of Office
|
Re: XML::LibXML namespaces after node removal
& XSLT I have a problem with namespaces after removal of a node from a
document. I want to remove a node, then write it out to disk as a
standalone fragment. But the namespace declarations are going missing.
For example:
my $doc = $p-> parse_string(
'<foo xmlns:bar="http://example.com/"> <bar:bar /></foo>'
);
my $barbar = $doc-> firstChild->firstChild;
$barbar-> unbindNode();
print $barbar-> toString();
Outputs:
<bar:bar/>
Instead of:
<bar:bar xmlns="http://example.com/"/>
And I can't see why this is happening? Can anyone help me with this?
I've attached the above as a test.
Thanks,
-Dom
Attachments:
libxml-namespace-after-removal.t
unknown1
unknown2
Thread:
Dominic Mitchell
Robin Berjon
Dominic Mitchell
Robin Berjon
Dominic Mitchell
Petr Pajas
|