Skip Menu |

This queue is for tickets about the XML-GDOME CPAN distribution.

Report information
The Basics
Id: 6331
Status: new
Priority: 0/
Queue: XML-GDOME

People
Owner: Nobody in particular
Requestors: nlany [...] uibe.edu.cn
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.86
Fixed in: (no value)



Subject: cloneNode bug
From XML::GOME::Node document on usage of $node = $n->cloneNode($deep); "deep": If true, recursively clone the subtree under the specified node;if false, clone only the node itself (and its attributes, if it is an Element). And when I code like this: my $newnode = $node->cloneNode(0); Attributes of $node will not be copied to $newnode. I am tring to find the bug in sources, but I am not familiar with Perl and C, anyone can give me a hand? I am using XML::GDOME 0.86 from CPAN, Perl v5.8.0 OS: RedHat 8.0.
[guest - Mon May 17 13:23:04 2004]: Hi it's me again, I traced the source, and found this behaviour relies on a function xmlDocCopyNode defined in tree API of libxml v2.6.x, the API doc says(http://xmlsoft.org/html/libxml-tree.html#xmlCopyNode): -- xmlNodePtr xmlCopyNode (const xmlNodePtr node, int extended) Do a copy of the node. node: the node extended: if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) Returns: a new #xmlNodePtr, or NULL in case of error. -- I compared it with the version on my local copy of libxml v2.4.x, which only says: "... recursive : if 1 do a recursive copy. " Which is better explained in http://mail.gnome.org/archives/xml/2001-June/msg00135.html So I think this bug could be fixed only when compiled with more recent version of libxml2, which do copy attributes and NMs along with the node. I dont know if XML::GDOME and libgdome should update their API and docs resp. If ture, someone on that maillist please report this to the authors.