Simple XML parser class.
This class is a simplified version of XML_Parser. In most XML applications the real action is executed, when a closing tag is found.
XML_Parser_Simple allows you to just implement one callback for each tag that will receive the tag with its attributes and CData.
- require_once '../Parser/Simple.php';
- class myParser extends XML_Parser_Simple
- {
- function myParser()
- {
- $this->XML_Parser_Simple();
- }
- function handleElement($name, $attribs, $data)
- {
- printf('handle %s<br>', $name);
- }
- }
- $p = &new myParser();
- $result = $p->setInputFile('myDoc.xml');
- $result = $p->parse();
Located in /PEAR/XML/Parser/Simple.php (line 79)
PEAR | --XML_Parser | --XML_Parser_Simple
Mapping from expat handler function to class method.
Inherited from XML_Parser
XML_Parser::$folding
XML_Parser::$fp
XML_Parser::$mode
XML_Parser::$parser
XML_Parser::$srcenc
XML_Parser::$tgtenc
XML_Parser::$_handlerObj
Creates an XML parser.
This is needed for PHP4 compatibility, it will call the constructor, when a new instance is created.
add some string to the current ddata.
This is commonly needed, when a document is parsed recursively.
get the current tag depth
The root tag is in depth 0.
handle a tag
Implement this in your parser
Reset the parser.
This allows you to use one parser instance to parse multiple XML documents.
Inherited From XML_Parser
XML_Parser::XML_Parser()
XML_Parser::__construct()
XML_Parser::endHandler()
XML_Parser::free()
XML_Parser::funcEndHandler()
XML_Parser::funcStartHandler()
XML_Parser::parse()
XML_Parser::parseString()
XML_Parser::raiseError()
XML_Parser::reset()
XML_Parser::setHandlerObj()
XML_Parser::setInput()
XML_Parser::setInputFile()
XML_Parser::setInputString()
XML_Parser::setMode()
XML_Parser::startHandler()
Inherited From PEAR
PEAR::PEAR()
PEAR::delExpect()
PEAR::expectError()
PEAR::getStaticProperty()
PEAR::isError()
PEAR::loadExtension()
PEAR::popErrorHandling()
PEAR::popExpect()
PEAR::pushErrorHandling()
PEAR::raiseError()
PEAR::registerShutdownFunc()
PEAR::setErrorHandling()
PEAR::staticPopErrorHandling()
PEAR::staticPushErrorHandling()
PEAR::throwError()
PEAR::_PEAR()
Documentation generated on Mon, 04 Dec 2006 11:10:10 -0500 by phpDocumentor 1.3.0RC3