profile06.phpt 410 B

1234567891011121314151617181920
  1. --TEST--
  2. SimpleXML [profile]: Accessing a namespaced attribute
  3. --EXTENSIONS--
  4. simplexml
  5. --FILE--
  6. <?php
  7. error_reporting(E_ALL & ~E_NOTICE);
  8. $root = simplexml_load_string('<?xml version="1.0"?>
  9. <root xmlns:reserved="reserved-ns">
  10. <child reserved:attribute="Sample" />
  11. </root>
  12. ');
  13. $attr = $root->child->attributes('reserved-ns');
  14. echo $attr['attribute'];
  15. echo "\n---Done---\n";
  16. ?>
  17. --EXPECT--
  18. Sample
  19. ---Done---