xml007.phpt 969 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. --TEST--
  2. xml_parse_into_struct/umlauts in tags
  3. --SKIPIF--
  4. <?php // vim600: syn=php
  5. include("skipif.inc");
  6. if(strtoupper("äöüß") != "ÄÖÜß")
  7. {
  8. die("skip strtoupper on non-ascii not supported on this platform");
  9. }
  10. ?>
  11. --FILE--
  12. <?php
  13. function startHandler($parser,$tag,$attr)
  14. {
  15. var_dump($tag,$attr);
  16. }
  17. function endHandler($parser,$tag)
  18. {
  19. var_dump($tag);
  20. }
  21. $xmldata = '<?xml version="1.0" encoding="ISO-8859-1"?><äöü üäß="Üäß">ÄÖÜ</äöü>';
  22. $parser = xml_parser_create('ISO-8859-1');
  23. xml_set_element_handler($parser, "startHandler", "endHandler");
  24. xml_parse_into_struct($parser, $xmldata, $struct, $index);
  25. var_dump($struct);
  26. ?>
  27. --EXPECT--
  28. string(3) "ÄÖÜ"
  29. array(1) {
  30. ["ÜÄß"]=>
  31. string(3) "Üäß"
  32. }
  33. string(3) "ÄÖÜ"
  34. array(1) {
  35. [0]=>
  36. array(5) {
  37. ["tag"]=>
  38. string(3) "ÄÖÜ"
  39. ["type"]=>
  40. string(8) "complete"
  41. ["level"]=>
  42. int(1)
  43. ["attributes"]=>
  44. array(1) {
  45. ["ÜÄß"]=>
  46. string(3) "Üäß"
  47. }
  48. ["value"]=>
  49. string(3) "ÄÖÜ"
  50. }
  51. }