bug54382.phpt 676 B

1234567891011121314151617181920212223242526
  1. --TEST--
  2. Bug #54382 DOMNode::getAttributeNodeNS doesn't get xmlns* attributes
  3. --EXTENSIONS--
  4. dom
  5. --FILE--
  6. <?php
  7. $xmlString = '<?xml version="1.0" encoding="utf-8" ?>
  8. <root xmlns="http://ns" xmlns:ns2="http://ns2">
  9. <ns2:child />
  10. </root>';
  11. $xml=new DOMDocument();
  12. $xml->loadXML($xmlString);
  13. $de = $xml->documentElement;
  14. $ns2 = $de->getAttributeNodeNS("http://www.w3.org/2000/xmlns/", "ns2");
  15. if ($ns2 == NULL) {
  16. echo 'namespace node does not exist.' . "\n";
  17. } else {
  18. echo 'namespace node prefix=' . $ns2->prefix . "\n";
  19. echo 'namespace node namespaceURI=' . $ns2->namespaceURI . "\n";
  20. }
  21. ?>
  22. --EXPECT--
  23. namespace node prefix=ns2
  24. namespace node namespaceURI=http://ns2