Bug #18197: DOMXML module have invalid handling of namespaces
| From: | flying at dom dot natm dot ru | Date: | Sat, 06 Jul 2002 10:11:21 +0000 |
| Subject: | Bug #18197: DOMXML module have invalid handling of namespaces | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-13298@lists.php.net to get a copy of this message | ||
From: flying@dom.natm.ru
Operating system: Any
PHP version: 4.2.1
PHP Bug Type: DOM XML related
Bug description: DOMXML module have invalid handling of namespaces
DOM XML module handle XML namespaces in a wrong way. Take a look at a
simple example:
<?php
$xml = xmldoc('<?xml version="1.0"?><root
xmlns:m="http://www.m.com/"/>');
$root = $xml->root();
$child = $root->add_child($xml->create_element('m:child'));
echo 'Namespace prefix: '.$child->prefix().'<br>';
echo 'Node name: '.$child->tagname().'<br>';
?>
It is obvious, that result should be:
Namespace prefix: m
Node name: child
But instead we have:
Namespace prefix:
Node name: m:child
Moreover, it is even possible to create nodes with undeclared namespaces,
like:
$child = $root->add_child($xml->create_element('q:child'));
and it will not return any errors. But XML document itself will be invalid
after it, because of undeclared namespace.
--
Edit bug report at http://bugs.php.net/?id=18197&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=18197&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=18197&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=18197&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=18197&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=18197&r=support
Expected behavior: http://bugs.php.net/fix.php?id=18197&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=18197&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=18197&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=18197&r=globals