1--TEST-- 2XML parser test, default namespaces 3--EXTENSIONS-- 4xml 5--SKIPIF-- 6<?php 7if (! @xml_parser_create_ns('ISO-8859-1')) { die("skip xml_parser_create_ns is not supported on this platform");} 8?> 9--FILE-- 10<?php 11function start_elem($parser,$name,$attribs) { 12 var_dump($name); 13} 14function end_elem() 15{ 16} 17 18$xml = <<<HERE 19<a xmlns="http://example.com/foo" 20 xmlns:bar="http://example.com/bar" 21 xmlns:baz="http://example.com/baz"> 22 <bar:b /> 23 <bar:c xmlns:bar="http://example.com/foo"/> 24</a> 25HERE; 26 27$parser = xml_parser_create_ns("ISO-8859-1","@"); 28xml_set_element_handler($parser,'start_elem','end_elem'); 29xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0); 30xml_parse($parser, $xml); 31xml_parser_free($parser); 32?> 33--EXPECT-- 34string(24) "http://example.com/foo@a" 35string(24) "http://example.com/bar@b" 36string(24) "http://example.com/foo@c" 37