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

Class: myParser2

Source Location: /XML_Parser-1.3.8/examples/xml_parser_simple2.php

Class Overview

PEAR
   |
   --XML_Parser
      |
      --XML_Parser_Simple
         |
         --myParser2

Simple XML parser class.


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 2004-2008 The PHP Group

Methods


Inherited Variables

Inherited Methods

Class: XML_Parser_Simple

XML_Parser_Simple::__construct()
Creates an XML parser.
XML_Parser_Simple::addToData()
add some string to the current ddata.
XML_Parser_Simple::getCurrentDepth()
get the current tag depth
XML_Parser_Simple::handleElement()
handle a tag
XML_Parser_Simple::reset()
Reset the parser.

Class: XML_Parser

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

Class Details

[line 17]
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.

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

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


[ Top ]


Method Detail

myParser   [line 19]

void myParser( )


[ Top ]


Documentation generated on Wed, 10 Apr 2019 14:24:06 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.