xref: /PHP-8.2/ext/dom/tests/gh12616_1.phpt (revision 3167d076)
1--TEST--
2GH-12616 (DOM: Removing XMLNS namespace node results in invalid default: prefix)
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7
8$doc = new DOMDocument();
9$doc->loadXML(
10    <<<XML
11    <container xmlns="http://symfony.com/schema/dic/services">
12      CHILDREN
13    </container>
14    XML
15);
16
17$doc->documentElement->removeAttributeNS('http://symfony.com/schema/dic/services', '');
18echo $doc->saveXML();
19
20$new = new DOMDocument();
21$new->append(
22    $new->importNode($doc->documentElement, true)
23);
24
25echo $new->saveXML();
26
27?>
28--EXPECT--
29<?xml version="1.0"?>
30<container>
31  CHILDREN
32</container>
33<?xml version="1.0"?>
34<container>
35  CHILDREN
36</container>
37