From: robin2008 at altruists dot org Operating system: Ubuntu PHP version: 5.2.9 PHP Bug Type: DOM XML related Bug description: importNode loses the namespace of an XML element.
Description:
------------
ImportNode don't treat namespace properly
Reproduce code:
---------------
<?php
// PHP 5.2.* namespace bug - A namespaced node loses its namespace on
import if
// (i) It has @xmlns=""
// (ii) A namespaceURI of its parent's @xmlns
$aDOM= new DOMDocument();
$aDOM->appendChild($aDOM->createElementNS(' http://friend2friend.net
','f2f:a'));
echo 'DOM to add into is '.$aDOM->saveXML().chr(13);
$fromdom= DOMDocument::loadXML('<?xml version="1.0"?><f2f:data xmlns:f2f="
http://friend2friend.net "><f2f:servicereq xmlns=" http://friend2friend.net
">
<f2f:WATCH-MY-NAMESPACE xmlns=""/></f2f:servicereq></f2f:data>
');
echo 'Dom to import from is'.$fromdom->saveXML().chr(13);
$imported= $aDOM->importNode($fromdom->firstChild->firstChild, 1);
$aDOM->appendChild($imported);
echo 'Result is '.$aDOM->saveXML();
?>
Expected result:
----------------
Namespace should be preserved
Actual result:
--------------
Namespace gets lost
--
Edit bug report at http://bugs.php.net/?id=47847&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=47847&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=47847&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=47847&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=47847&r=fixedcvs
Fixed in CVS and need be documented:
http://bugs.php.net/fix.php?id=47847&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=47847&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=47847&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=47847&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=47847&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=47847&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=47847&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=47847&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=47847&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=47847&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=47847&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=47847&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=47847&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=47847&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=47847&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=47847&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=47847&r=mysqlcfg
