Annotation of embedaddon/php/ext/xml/tests/bug46699.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #46699: (xml_parse crash when parser is namespace aware)
! 3: --SKIPIF--
! 4: <?php
! 5: require_once("skipif.inc");
! 6: if (! @xml_parser_create_ns('ISO-8859-1')) { die("skip xml_parser_create_ns is not supported on this platform");}
! 7: ?>
! 8: --FILE--
! 9: <?php
! 10: function defaultfunc($parser, $data)
! 11: {
! 12: echo $data;
! 13: }
! 14:
! 15: $xml = <<<HERE
! 16: <a xmlns="http://example.com/foo"
! 17: xmlns:bar="http://example.com/bar">
! 18: <bar:b foo="bar">1</bar:b>
! 19: <bar:c bar:nix="null" foo="bar">2</bar:c>
! 20: </a>
! 21: HERE;
! 22:
! 23: $parser = xml_parser_create_ns("ISO-8859-1","@");
! 24: xml_set_default_handler($parser,'defaultfunc');
! 25: xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0);
! 26: xml_parse($parser, $xml);
! 27: xml_parser_free($parser);
! 28: ?>
! 29: --EXPECT--
! 30: <a xmlns="http://example.com/foo" xmlns:bar="http://example.com/bar">
! 31: <bar:b foo="bar">1</bar:b>
! 32: <bar:c bar:nix="null" foo="bar">2</bar:c>
! 33: </a>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>