Annotation of embedaddon/php/ext/xml/tests/bug25666.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #25666 (XML namespaces broken in libxml-based SAX interface)
! 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 start_elem($parser,$name,$attribs) {
! 11: var_dump($name);
! 12: }
! 13: function end_elem()
! 14: {
! 15: }
! 16:
! 17: $xml = <<<HERE
! 18: <foo:a xmlns:foo="http://example.com/foo"
! 19: xmlns:bar="http://example.com/bar"
! 20: xmlns:baz="http://example.com/baz">
! 21: <bar:b />
! 22: <baz:c />
! 23: </foo>
! 24: HERE;
! 25:
! 26: $parser = xml_parser_create_ns("ISO-8859-1","@");
! 27: xml_set_element_handler($parser,'start_elem','end_elem');
! 28: xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0);
! 29: xml_parse($parser, $xml);
! 30: xml_parser_free($parser);
! 31: ?>
! 32: --EXPECT--
! 33: string(24) "http://example.com/foo@a"
! 34: string(24) "http://example.com/bar@b"
! 35: string(24) "http://example.com/baz@c"
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>