bug47848.phpt 645 B

12345678910111213141516171819202122232425
  1. --TEST--
  2. Bug #47848 (importNode doesn't preserve attribute namespaces)
  3. --EXTENSIONS--
  4. dom
  5. --FILE--
  6. <?php
  7. $aDOM = new DOMDocument();
  8. $aDOM->appendChild($aDOM->createElementNS('http://friend2friend.net/','f2f:a'));
  9. $fromdom = new DOMDocument();
  10. $fromdom->loadXML('<data xmlns:ai="http://altruists.org" ai:attr="namespaced" />');
  11. $attr= $fromdom->firstChild->attributes->item(0);
  12. $att = $aDOM->importNode($attr);
  13. $aDOM->documentElement->appendChild($aDOM->importNode($attr, true));
  14. echo $aDOM->saveXML();
  15. ?>
  16. --EXPECT--
  17. <?xml version="1.0"?>
  18. <f2f:a xmlns:f2f="http://friend2friend.net/" xmlns:ai="http://altruists.org" ai:attr="namespaced"/>