xref: /PHP-8.1/ext/dom/tests/bug47849.phpt (revision bd9f4fa6)
1--TEST--
2Bug #47849 (Non-deep import loses the namespace).
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7
8$aDOM= new DOMDocument();
9$aDOM->appendChild($aDOM->createElementNS('urn::root','r:root'));
10
11$fromdom= new DOMDocument();
12$fromdom->loadXML('<data xmlns="urn::data">aaa</data>');
13
14$data= $fromdom->documentElement;
15$aDOM->documentElement->appendChild($aDOM->importNode($data));
16
17echo $aDOM->saveXML();
18
19?>
20--EXPECT--
21<?xml version="1.0"?>
22<r:root xmlns:r="urn::root"><data xmlns="urn::data"/></r:root>
23