Can't see namespace definition with DOMXML in 4.2.1?
| From: | Thalis A. Kalfigopoulos | Date: | Wed, 15 May 2002 16:59:17 +0000 |
| Subject: | Can't see namespace definition with DOMXML in 4.2.1? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-97797@lists.php.net to get a copy of this message | ||
It seems that lots of DOM stuff was added in 4.2.1! Still I can't seem to see the namespace
definition attributes of an element.
The code:
$xmlstr='<?xml version="1.0"?><element xmlns:ns1="http://www.ns.com/ns1/"
attr="value"/>';
$domdoc=domxml_open_mem($xmlstr);
$root=$domdoc->document_element();
echo("<pre>".htmlentities($domdoc->html_dump_mem())."</pre>");
just returns:
<element attr="value"></element>
instead of the full:
<element xmlns:ns1="http://www.ns.com/ns1/"
attr="value"></element>
Even trying to get the attributes from <element> with $elem->attributes() returns an array
that only contains only "attr" but "xmlns:ns1" is nowhere to be seen.
Is there a way to get the namespace definitions at the moment or is the code not in place yet?
thanks in advance,
thalis