blob: 927a6e59e63deca6ecf665d847e1cc70573d1229 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
--TEST--
Bug #46185 (importNode changes the namespace of an XML element).
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
$aDOM = new DOMDocument();
$aDOM->loadXML('<?xml version="1.0"?>
<ns1:a xmlns:ns1="urn::ns"/>');
$a= $aDOM->firstChild;
$ok = new DOMDocument();
$ok->loadXML('<?xml version="1.0"?>
<ns1:ok xmlns:ns1="urn::ns" xmlns="urn::REAL"><watch-me xmlns:default="urn::BOGUS"/></ns1:ok>');
$imported= $aDOM->importNode($ok->firstChild, true);
$a->appendChild($imported);
echo $aDOM->saveXML();
?>
--EXPECT--
<?xml version="1.0"?>
<ns1:a xmlns:ns1="urn::ns"><ns1:ok xmlns="urn::REAL"><watch-me xmlns:default="urn::BOGUS"/></ns1:ok></ns1:a>
|