You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by bu...@apache.org on 2001/06/12 22:08:54 UTC
[Bug 1533] - DOM_Node::cloneNode() does not clone the pointer value via setUserData()
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=1533
*** shadow/1533 Sun May 20 17:26:16 2001
--- shadow/1533.tmp.6649 Tue Jun 12 13:08:54 2001
***************
*** 1,18 ****
! Bug#: 1533
! Product: Xerces-C
! Version: 1.4
! Platform: Sun
! OS/Version: Solaris
! Status: NEW
! Resolution:
! Severity: Normal
! Priority:
! Component: DOM
! AssignedTo: xerces-c-dev@xml.apache.org
! ReportedBy: jmf@abysal.com
! URL:
! Summary: DOM_Node::cloneNode() does not clone the pointer value via setUserData()
!
Why DOM_Node::cloneNode() does not clone the pointer assigned to a NOM_Node via
DOM_Node::setUserData()?
--- 1,18 ----
! +============================================================================+
! | DOM_Node::cloneNode() does not clone the pointer value via setUserData() |
! +----------------------------------------------------------------------------+
! | Bug #: 1533 Product: Xerces-C |
! | Status: RESOLVED Version: 1.4 |
! | Resolution: WONTFIX Platform: Sun |
! | Severity: Normal OS/Version: Solaris |
! | Priority: High Component: DOM |
! +----------------------------------------------------------------------------+
! | Assigned To: xerces-c-dev@xml.apache.org |
! | Reported By: jmf@abysal.com |
! +----------------------------------------------------------------------------+
! | URL: |
! +============================================================================+
! | DESCRIPTION |
Why DOM_Node::cloneNode() does not clone the pointer assigned to a NOM_Node via
DOM_Node::setUserData()?
***************
*** 24,26 ****
--- 24,64 ----
and when I clone this node, the getUserData() of the cloned node returns
processed=0.
+
+ ------- Additional Comments From tng@ca.ibm.com 2001-06-12 13:08 -------
+ FYI. Here is one of the response from xerces-c-dev mailing list:
+ --------------------------------------------------------------------
+ Subject: Re: [Bug 1533] New - DOM_Node::cloneNode() does not clone the pointer
+ value via setUserData()
+ Date: Thu, 26 Apr 2001 11:19:37 -0400
+ From: Joseph_Kesselman@lotus.com
+ Reply-To: xerces-c-dev@xml.apache.org
+ To: xerces-c-dev@xml.apache.org
+
+
+ Working As Designed.
+
+ There are three options here:
+ 1) Copy the userData pointer to the new node.
+ 2) Have the new node point to a new clone of the userData object.
+ 3) Have the new node start with userData empty
+
+ All of these are the right answer for some applications and absolutely the
+ wrong answer for others. Our DOM has no way of knowing which one you want,
+ and has to pick one. And the right answer may differ from node to node,
+ which is a problem when doing a deep clone.
+
+ We picked option (3), which is the safest of the three. If you want one of
+ the other options, you can write a convenience function which wraps around
+ cloneNode and copies/clones as much or as little userData as you want to
+ retain.
+
+ (It would be possible to build a system in which userData objects were
+ required to implement an interface that allowed them to tell cloneNode
+ whether they should be copied or not. But that's much more complicated than
+ we really wanted to deal with.)
+
+
+ Note that userData is a custom feature of this DOM, and may be phased out
+ when DOM Level 3's nodeKey feature comes in and permits a more portable
+ solutoin.
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org