|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2023-04-22 05:02 UTC] hunthealth8 at gmail dot com
[2023-06-16 21:18 UTC] nielsdos@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: nielsdos
[2023-06-16 21:18 UTC] nielsdos@php.net
[2023-09-28 17:34 UTC] nielsdos@php.net
-Status: Closed
+Status: Re-Opened
[2023-09-28 17:34 UTC] nielsdos@php.net
[2024-03-09 16:06 UTC] nielsdos@php.net
-Status: Re-Opened
+Status: Closed
[2024-03-09 16:06 UTC] nielsdos@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 18 11:00:01 2025 UTC |
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