XML_Parser2
[ class tree: XML_Parser2 ] [ index: XML_Parser2 ] [ all elements ]

Class: myParser2

Source Location: /XML_Parser2-0.1.0/examples/xml_parser_simple2.php

Class Overview

XML_Parser2
   |
   --XML_Parser2_Simple
      |
      --myParser2

Simple XML parser class.


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 2004-2008 The PHP Group

Inherited Variables

Inherited Methods

Class: XML_Parser2_Simple

XML_Parser2_Simple::addToData()
add some string to the current ddata.
XML_Parser2_Simple::getCurrentDepth()
get the current tag depth
XML_Parser2_Simple::handleElement()
handle a tag
XML_Parser2_Simple::reset()
Reset the parser.

Class: XML_Parser2

XML_Parser2::__construct()
PHP5 constructor
XML_Parser2::endHandler()
abstract method signature for End Handler
XML_Parser2::free()
XML_Parser2::free()
XML_Parser2::funcEndHandler()
derives and calls the End Handler function
XML_Parser2::funcStartHandler()
derives and calls the Start Handler function
XML_Parser2::parse()
Central parsing function.
XML_Parser2::parseString()
XML_Parser2::parseString()
XML_Parser2::reset()
Reset the parser.
XML_Parser2::setHandlerObj()
Sets the object, that will handle the XML events
XML_Parser2::setInput()
Sets the file handle to use with parse().
XML_Parser2::setInputFile()
Sets the input xml file to be parsed
XML_Parser2::setInputString()
XML_Parser2::setInputString()
XML_Parser2::setMode()
Sets the mode of the parser.
XML_Parser2::startHandler()
abstract method signature for Start Handler

Class Details

[line 17]
Simple XML parser class.

This class is a simplified version of XML_Parser2. In most XML applications the real action is executed, when a closing tag is found.

XML_Parser2_Simple allows you to just implement one callback for each tag that will receive the tag with its attributes and CData.

  1.  require_once '../Parser/Simple.php';
  2.  
  3.  class myParser extends XML_Parser2_Simple
  4.  {
  5.  
  6.     function handleElement($name$attribs$data)
  7.      {
  8.          printf('handle %s<br>'$name);
  9.      }
  10.  }
  11.  
  12.  $p = new myParser();
  13.  
  14.  $result $p->setInputFile('myDoc.xml');
  15.  $result $p->parse();

  • Author: Stephan Schmidt <schst@php.net>
  • Version: Release: @package_version@
  • Copyright: 2004-2008 The PHP Group


[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:47:55 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.