1--TEST-- 2DOM-Parsing GH-44 (It's possible for 'generate a prefix' algorithm to generate a prefix conflicting with an existing one) 3--EXTENSIONS-- 4dom 5--FILE-- 6<?php 7 8$root = Dom\XMLDocument::createFromString('<root xmlns:ns2="uri2"><child xmlns:ns1="uri1" xmlns:a0="uri1" xmlns:NS1="uri1"/></root>')->documentElement; 9$root->firstChild->setAttributeNS('uri3', 'attr1', 'value1'); 10echo $root->ownerDocument->saveXml(), "\n"; 11 12?> 13--EXPECT-- 14<?xml version="1.0" encoding="UTF-8"?> 15<root xmlns:ns2="uri2"><child xmlns:ns1="uri1" xmlns:a0="uri1" xmlns:NS1="uri1" xmlns:ns2="uri3" ns2:attr1="value1"/></root> 16