From:             stein at lakenet dot no
Operating system: Any
PHP version:      5CVS-2003-12-26 (dev)
PHP Bug Type:     *General Issues
Bug description:  domNode::appendChild() changes child node namespace

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>



-- 
Edit bug report at http://bugs.php.net/?id=26723&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=26723&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=26723&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=26723&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=26723&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=26723&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=26723&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=26723&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=26723&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=26723&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=26723&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=26723&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=26723&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26723&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=26723&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=26723&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=26723&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26723&r=float

Reply via email to