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

Class: myParser2

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

Class Overview

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

Simple XML parser class.


Author(s):

Methods


Inherited Variables

Inherited Methods

Class: XML_Parser_Simple

XML_Parser_Simple::XML_Parser_Simple()
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::XML_Parser()
Creates an XML parser.
XML_Parser::endHandler()
XML_Parser::free()
XML_Parser::free()
XML_Parser::funcEndHandler()
XML_Parser::funcStartHandler()
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()

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();



[ Top ]


Method Detail

myParser   [line 19]

void myParser( )


[ Top ]


Documentation generated on Mon, 11 Apr 2005 15:11:21 -0400 by phpDocumentor 1.2.3. PEAR Logo Copyright © PHP Group 2004.