#19333 [Com]: incorrect handling of xml namespace
| From: | pavlomr at hotmail dot com | Date: | Tue, 10 Sep 2002 17:28:06 +0000 |
| Subject: | #19333 [Com]: incorrect handling of xml namespace | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-18965@lists.php.net to get a copy of this message | ||
ID: 19333
Comment by: pavlomr@hotmail.com
Reported By: pavlomr@hotmail.com
Status: Closed
Bug Type: DOM XML related
Operating System: SuSE Linux 7.3
PHP Version: 4CVS-2002-09-10
New Comment:
It is strange , that in previous snapshot (4CVS-2002-09-06) output was
correct (but segfaults).
And $d2->dump_mem() produce correct output.
Previous Comments:
------------------------------------------------------------------------
[2002-09-10 11:29:14] chregu@php.net
Hi
The Namespace xml is defined per default and does not have to be
declared explicitely.
If the parser does not understand this, then it's its fault and it does
not correpsond to the w3c-specs.
chregu
------------------------------------------------------------------------
[2002-09-10 09:05:38] pavlomr@hotmail.com
environment as in #19266
example:
<?php
$x1="<?xml version='1.0' encoding='iso8859-1' ?>
<root1 xml:lang='de' xmlns:xml='http://www.w3.org/XML/1998/namespace'>
<node xml:lang='en'>1 En node</node>
<node xml:lang='de'>1 De node</node>
<node>1 Default node</node>
</root1>
";
$x2="<?xml version='1.0' encoding='iso8859-1' ?>
<root2 xml:lang='en'
xmlns:xml='http://www.w3.org/XML/1998/namespace'>
<node xml:lang='en'>2 En node</node>
<node xml:lang='de'>2 De node</node>
<node> 2 Default node</node>
</root2>
";
$d1=domxml_open_mem($x1);
$d2=domxml_open_mem($x2);
$r1=$d1->document_element();
$r2=$d2->document_element();
$r1->append_child($r2->clone_node(1));
echo $d1->dump_mem();
?>
produce:
<?xml version="1.0" encoding="iso8859-1"?>
<root1 xml:lang="de">
<node xml:lang="en">1 En node</node>
<node xml:lang="de">1 De node</node>
<node>1 Default node</node>
<root2 lang="en">
<node lang="en">2 En node</node>
<node lang="de">2 De node</node>
<node> 2 Default node</node>
</root2></root1>
------------------------------------
xml prefix of xml:lang is lost !
it's independent from xmlns declaration.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=19333&edit=1