|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-01-11 01:56 UTC] clynx at users dot sourceforge dot net
[2005-01-11 08:19 UTC] chregu@php.net
[2005-01-11 09:18 UTC] clynx at users dot sourceforge dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 13 21:00:01 2025 UTC |
Description: ------------ I want to use a complete Namespace to execute self written PHP Classes. My Parser has some Problems with the way PHP handles the Code. It seems like my code handles all dom Functions right, but the Result is not the one I would expect. Reproduce code: --------------- <?php $dom = new DOMDocument(); $dom->load("http://www.succont.de/php/domxml.xml"); $nodelist=$dom->getElementsByTagNameNS( 'http://test.de/test', '*' ); for($i = 0; $i < $nodelist->length; $i++) { $node = $nodelist->item($i); if($node->localName == "test") { $node->parentNode->removeChild($node); echo $node->localName . " removed \n"; } else { echo 'handle: ' . $node->localName . "\n"; } } echo "\nXML File:\n".$dom->saveXML(); ?> Expected result: ---------------- bash-2.05a$ php -q test.php handle: doSomething test removed handle: doSomething XML File: <?xml version="1.0" encoding="utf-8"?> <example xmlns:test="http://test.de/test"> <test:doSomething/> <test:doSomething/> </example> Actual result: -------------- bash-2.05a$ php -q test.php handle: doSomething test removed XML File: <?xml version="1.0" encoding="utf-8"?> <example xmlns:test="http://test.de/test"> <test:doSomething/> <test:doSomething/> </example>