2
XML parser test, attributes
5
if (! @xml_parser_create_ns('ISO-8859-1')) { die("skip xml_parser_create_ns is not supported on this plattform");}
9
function start_elem($parser,$name,$attribs) {
12
foreach($attribs as $key => $value) {
13
print "$key = $value ";
22
<a xmlns="http://example.com/foo"
23
xmlns:bar="http://example.com/bar">
25
<bar:c bar:nix="null" foo="bar"/>
29
$parser = xml_parser_create_ns("ISO-8859-1","@");
30
xml_set_element_handler($parser,'start_elem','end_elem');
31
xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0);
32
xml_parse($parser, $xml);
33
xml_parser_free($parser);
36
http://example.com/foo@a
37
http://example.com/bar@b foo = bar
38
http://example.com/bar@c http://example.com/bar@nix = null foo = bar