profile07.phpt 499 B

1234567891011121314151617181920212223
  1. --TEST--
  2. SimpleXML [profile]: Accessing an aliased 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. $rsattr = $root->child->attributes('reserved');
  14. $myattr = $root->child->attributes('reserved-ns');
  15. echo $rsattr['attribute'];
  16. echo $myattr['attribute'];
  17. echo "\n---Done---\n";
  18. ?>
  19. --EXPECT--
  20. Sample
  21. ---Done---