From:             [EMAIL PROTECTED]
Operating system: Linux
PHP version:      4.1.2
PHP Bug Type:     DOM XML related
Bug description:  replace_node feature

I realize that for replace_node, the W3C recommendation suggests that you
should return the node that was removed.  However, this presents a problem
when you are actually trying to write code with the xml functions.  If you
create a new node (or import it from another document, or even clone it)
and then you do a replace node somewhere, removing the previous node and
putting in your new node, there is no way to access the node you just put
in.  For all intents and purposes, you have lost your place in the
document.  I don't think the function should change per say, but rather
this following distinction.

1. Create a new node and return it to a variable $foo
2. Select a node that will be replaced $bar
3. Replace $bar with $foo using $bar->replace_node($foo)
4. Now, $foo should be a reference to the node in its new location.  This
argument is based on the recommendation sentence which states "if the
newChild is already in the tree, it is first removed".  Hence, it would be
impossible for the reference $foo to exist anywhere else then in its new
location.

Thoughts?
-- 
Edit bug report at http://bugs.php.net/?id=15949&edit=1
-- 
Fixed in CVS:        http://bugs.php.net/fix.php?id=15949&r=fixedcvs
Fixed in release:    http://bugs.php.net/fix.php?id=15949&r=alreadyfixed
Need backtrace:      http://bugs.php.net/fix.php?id=15949&r=needtrace
Try newer version:   http://bugs.php.net/fix.php?id=15949&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=15949&r=support
Expected behavior:   http://bugs.php.net/fix.php?id=15949&r=notwrong
Not enough info:     http://bugs.php.net/fix.php?id=15949&r=notenoughinfo
Submitted twice:     http://bugs.php.net/fix.php?id=15949&r=submittedtwice

Reply via email to