SimpleXML - add a new node using a namespace previously declared - how?
问题 I would like to add a child, on a very specific place (so I'm also using DOM and not only simpleXML) for <domain:create> node. I have tried to use the $ns attribute on simpleXML construct. $nsNode = new SimpleXMLElement('<domain:ns>', $options = 0, $ns='urn:ietf:params:xml:ns:domain-1.0'); //transform the target into dom object for manipulation $nodeRegistrantDom = dom_import_simplexml($nodeRegistrant); But I'm getting: I/O warning : failed to load external entity "<domain:ns>" I've tried to