1--TEST-- 2DOM: specific namespace behaviour for applications with fixed serialization requirements 3--EXTENSIONS-- 4dom 5--FILE-- 6<?php 7 8$dom1 = new DOMDocument(); 9$dom1->loadXML(<<<XML 10<wsse:Security xmlns:wsse="foo:bar"> 11 <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> 12 </ds:Signature> 13</wsse:Security> 14XML); 15$dom2 = new DOMDocument(); 16$dom2->loadXML('<xml><child/></xml>'); 17$wsse = $dom2->importNode($dom1->documentElement, true); 18$dom2->firstChild->firstChild->appendChild($wsse); 19echo $dom2->saveXML(); 20 21?> 22--EXPECT-- 23<?xml version="1.0"?> 24<xml><child><wsse:Security xmlns:wsse="foo:bar" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> 25 <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> 26 </ds:Signature> 27</wsse:Security></child></xml> 28