}
$p = new myParser;
$p->parse("example.xml");
?>
xml_parser_set_option(integer parser, integer option, value
data)
Use xml_parser_set_option to change the value of an option. Table 14.14 lists
the available options.
Table 14.14. XML Option Constants
XML_OPTION_CASE_FOLDING
XML_OPTION_SKIP_TAGSTART
XML_OPTION_SKIP_WHITE
XML_OPTION_TARGET_ENCODING
boolean xml_set_character_data_handler(integer parser,
string function)
Character data is the text that appears between tags, and
xml_set_character_data_handler sets the function executes when it is
encountered. Character data may span many lines and may cause several events. PHP
will not concatenate the data for you.
The function specified in the function argument must take two arguments. The first is
the parser identifier, an integer. The second is a string containing the character data.
boolean xml_set_default_handler(integer parser, string
function)
The xml_set_default_handler function captures any text not handled by the
other handlers. This includes the DTD declaration and the XML tag.
The function specified in the function argument must take two arguments. The first is
the parser identifier, an integer. The second is a string containing the data.
boolean xml_set_element_handler(integer parser, string start,
string end)
Use xml_set_element_handler to assign the two functions that handle start tags
and end tags.