Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

54 lines (47 sloc) 1.05 kb
<?PHP
/**
* example for XML_Parser_Simple
*
* @author Stephan Schmidt <schst@php-tools.net>
* @package XML_Parser
* @subpackage Examples
*/
/**
* require the parser
*/
require_once 'XML/Parser.php';
class myParser extends XML_Parser
{
function myParser()
{
parent::XML_Parser();
}
/**
* handle start element
*
* @access private
* @param resource xml parser resource
* @param string name of the element
* @param array attributes
*/
function startHandler($xp, $name, $attribs)
{
printf('handle start tag: %s<br />', $name);
}
/**
* handle start element
*
* @access private
* @param resource xml parser resource
* @param string name of the element
* @param array attributes
*/
function endHandler($xp, $name)
{
printf('handle end tag: %s<br />', $name);
}
}
$p = &new myParser();
$result = $p->setInputFile('xml_parser_file.xml');
$result = $p->parse();
?>
Jump to Line
Something went wrong with that request. Please try again.