Moodle  2.2.1
http://www.collinsharper.com
XML_Parser_Simple Class Reference
Inheritance diagram for XML_Parser_Simple:
Collaboration diagram for XML_Parser_Simple:

Public Member Functions

 XML_Parser_Simple ($srcenc=null, $mode= 'event', $tgtenc=null)
 _initHandlers ()
 reset ()
 startHandler ($xp, $elem, &$attribs)
 endHandler ($xp, $elem)
 cdataHandler ($xp, $data)
 handleElement ($name, $attribs, $data)
 getCurrentDepth ()
 addToData ($data)

Data Fields

 $_elStack = array()
 $_data = array()
 $_depth = 0
 $handler

Detailed Description

Definition at line 96 of file Simple.php.


Member Function Documentation

inits the handlers

Returns:
mixed private

set additional handlers for character data, entities, etc.

Reimplemented from XML_Parser.

Definition at line 159 of file Simple.php.

Here is the call graph for this function:

addToData ( data)

add some string to the current ddata.

This is commonly needed, when a document is parsed recursively.

Parameters:
string$datadata to add
Returns:
void public

Definition at line 321 of file Simple.php.

cdataHandler ( xp,
data 
)

handle character data

Parameters:
resource$xpxml parser resource
string$datadata
Returns:
void private

Definition at line 276 of file Simple.php.

endHandler ( xp,
elem 
)

end handler

Pulls attributes and tagname from a stack

Parameters:
resource$xpxml parser resource
string$elemelement name
Returns:
mixed private

Reimplemented from XML_Parser.

Definition at line 243 of file Simple.php.

get the current tag depth

The root tag is in depth 0.

public

Returns:
integer

Definition at line 306 of file Simple.php.

handleElement ( name,
attribs,
data 
)

handle a tag

Implement this in your parser

Parameters:
string$nameelement name
array$attribsattributes
string$datacharacter data
Returns:
void public

Definition at line 294 of file Simple.php.

reset ( )

Reset the parser.

This allows you to use one parser instance to parse multiple XML documents.

public

Returns:
boolean|object true on success, PEAR_Error otherwise

Reimplemented from XML_Parser.

Definition at line 195 of file Simple.php.

Here is the call graph for this function:

startHandler ( xp,
elem,
&$  attribs 
)

start handler

Pushes attributes and tagname onto a stack

Parameters:
resource$xpxml parser resource
string$elemelement name
array&$attribsattributes
Returns:
mixed private

Reimplemented from XML_Parser.

Definition at line 221 of file Simple.php.

XML_Parser_Simple ( srcenc = null,
mode = 'event',
tgtenc = null 
)

Creates an XML parser.

This is needed for PHP4 compatibility, it will call the constructor, when a new instance is created.

Parameters:
string$srcencsource charset encoding, use NULL (default) to use whatever the document specifies
string$modehow this parser object should work, "event" for handleElement(), "func" to have it call functions named after elements (handleElement_$name())
string$tgtenca valid target encoding

Definition at line 148 of file Simple.php.

Here is the call graph for this function:


Field Documentation

$_data = array()

Definition at line 112 of file Simple.php.

$_depth = 0

Definition at line 120 of file Simple.php.

$_elStack = array()

Definition at line 104 of file Simple.php.

$handler
Initial value:
 array(
        'default_handler'                   => 'defaultHandler',
        'processing_instruction_handler'    => 'piHandler',
        'unparsed_entity_decl_handler'      => 'unparsedHandler',
        'notation_decl_handler'             => 'notationHandler',
        'external_entity_ref_handler'       => 'entityrefHandler'
    )

Reimplemented from XML_Parser.

Definition at line 127 of file Simple.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations