1--TEST-- 2XML serializer spec errata: xmlns="" serialization should be allowed 3--EXTENSIONS-- 4dom 5--FILE-- 6<?php 7 8// Should be allowed 9$dom = Dom\XMLDocument::createFromString('<root><x xmlns=""/></root>'); 10var_dump($dom->documentElement->innerHTML); 11 12// Should not be allowed 13$dom = Dom\XMLDocument::createFromString('<root><x/></root>'); 14$x = $dom->documentElement->firstChild; 15$x->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:a', ''); 16try { 17 var_dump($dom->documentElement->innerHTML); 18} catch (DOMException $e) { 19 echo $e->getMessage(), "\n"; 20} 21 22?> 23--EXPECT-- 24string(13) "<x xmlns=""/>" 25The resulting XML serialization is not well-formed 26