Bug #18200: xpath_eval should return a reference to the DOM node and not a copy

From: Date: Sat, 06 Jul 2002 18:06:51 +0000
Subject: Bug #18200: xpath_eval should return a reference to the DOM node and not a copy
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-13322@lists.php.net to get a copy of this message
From: lrargerich@yahoo.com Operating system: All PHP version: 4.2.1 PHP Bug Type: DOM XML related Bug description: xpath_eval should return a reference to the DOM node and not a copy Now, the xpath_eval function returns a copy of the DOM nodes in the nodeset array, in my opinion the nodeset should be an array of references to DOMNodes in the tree. In this way if you change a node in the result set the document changes. If you find this problematic for existing applications you might want to add an aditional parameter to xpath_eval allowing the user to indicate if he wants references or copies back. However in my opinion xpath_eval should return references and if the user wants a copy he just makes the copy himself. This change allows a lot of interesting features to XML editing using Xpath selectors from PHP. This will allow, for example, an easy implementation of XUpdate using the DOM extension. Thanks for reading my suggestion. -- Edit bug report at http://bugs.php.net/?id=18200&edit=1 -- Fixed in CVS: http://bugs.php.net/fix.php?id=18200&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=18200&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=18200&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=18200&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=18200&r=support Expected behavior: http://bugs.php.net/fix.php?id=18200&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=18200&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=18200&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=18200&r=globals

« previous php.bugs (#13322) next »