#19333 [Opn->Csd]: incorrect handling of xml namespace

From: Date: Tue, 10 Sep 2002 16:29:14 +0000
Subject: #19333 [Opn->Csd]: incorrect handling of xml namespace
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-18958@lists.php.net to get a copy of this message
 ID:               19333
 Updated by:       chregu@php.net
 Reported By:      pavlomr@hotmail.com
-Status:           Open
+Status:           Closed
 Bug Type:         DOM XML related
 Operating System: SuSE Linux 7.3
 PHP Version:      4CVS-2002-09-10
 New Comment:

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


Previous Comments:
------------------------------------------------------------------------

[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



Thread (4 messages)

« previous php.bugs (#18958) next »