php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26723 domNode::appendChild() changes child node namespace
Submitted: 2003-12-26 17:47 UTC Modified: 2003-12-27 10:46 UTC
From: stein at lakenet dot no Assigned:
Status: Closed Package: *General Issues
PHP Version: 5CVS-2003-12-26 (dev) OS: Any
Private report: No CVE-ID:
 [2003-12-26 17:47 UTC] stein at lakenet dot no
Description:
------------
When appending a node from an imported node
(it does not seem to be a factor that the node
 is imported) the namespace of the element is
changed (incorrectly)

This problem exists with 5b3 (missing menu-option)

Leaving out lines ~ 1103 - 1112 in ext/dom/node.c solves the problem with the following example, but i guess that its not the permanent solution ;) 




Reproduce code:
---------------
# tar czvf appendChild_bug.tgz appendChild_bug/
appendChild_bug/
appendChild_bug/doc.xml
appendChild_bug/impdoc.xml
appendChild_bug/bug.php

http://eks.lakenet.no/2003/appendChild_bug.tgz

(898 bytes)


Expected result:
----------------
<?xml version="1.0"?>
<rootElt xmlns:x="http://ns.null.no/x">
 <nonamespacenode/>
 <x:namespacenode/>
 <!-- append after here -->
<impDoc>
 <!-- impdoc is not in any namespace -->
 <nonamespacenode/>
 <x:namespacenode/>
<impDoc></rootElt>



Actual result:
--------------
<?xml version="1.0"?>
<rootElt xmlns:x="http://ns.null.no/x">
 <nonamespacenode/>
 <x:namespacenode/>
 <!-- append after here -->
<x:impDoc>
 <!-- impdoc is not in any namespace -->
 <nonamespacenode/>
 <x:namespacenode/>
</x:impDoc></rootElt>



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-12-27 05:27 UTC] rrichards@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 [2003-12-27 06:38 UTC] stein at lakenet dot no
Just checked with php5-200312271030.tar.bz2 from
snaps.php.net. The bug is not fixed in CVS.
 [2003-12-27 07:03 UTC] rrichards@php.net
Wait for the next snap or grab the node.c file from CVS.
 [2003-12-27 10:46 UTC] stein at lakenet dot no
All reconciled!
The unecessary ns declaration on impdoc is skipped too :)
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Fri Apr 18 10:03:03 2014 UTC