|
Moodle
2.2.1
http://www.collinsharper.com
|


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 | |
Definition at line 96 of file Simple.php.
| _initHandlers | ( | ) |
inits the handlers
set additional handlers for character data, entities, etc.
Reimplemented from XML_Parser.
Definition at line 159 of file Simple.php.

| addToData | ( | $ | data | ) |
add some string to the current ddata.
This is commonly needed, when a document is parsed recursively.
| string | $data | data to add |
Definition at line 321 of file Simple.php.
| cdataHandler | ( | $ | xp, |
| $ | data | ||
| ) |
handle character data
| resource | $xp | xml parser resource |
| string | $data | data |
Definition at line 276 of file Simple.php.
| endHandler | ( | $ | xp, |
| $ | elem | ||
| ) |
end handler
Pulls attributes and tagname from a stack
| resource | $xp | xml parser resource |
| string | $elem | element name |
Reimplemented from XML_Parser.
Definition at line 243 of file Simple.php.
| getCurrentDepth | ( | ) |
get the current tag depth
The root tag is in depth 0.
public
Definition at line 306 of file Simple.php.
| handleElement | ( | $ | name, |
| $ | attribs, | ||
| $ | data | ||
| ) |
handle a tag
Implement this in your parser
| string | $name | element name |
| array | $attribs | attributes |
| string | $data | character data |
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
Reimplemented from XML_Parser.
Definition at line 195 of file Simple.php.

| startHandler | ( | $ | xp, |
| $ | elem, | ||
| &$ | attribs | ||
| ) |
start handler
Pushes attributes and tagname onto a stack
| resource | $xp | xml parser resource |
| string | $elem | element name |
| array | &$attribs | attributes |
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.
| string | $srcenc | source charset encoding, use NULL (default) to use whatever the document specifies |
| string | $mode | how this parser object should work, "event" for handleElement(), "func" to have it call functions named after elements (handleElement_$name()) |
| string | $tgtenc | a valid target encoding |
Definition at line 148 of file Simple.php.

| $_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 |
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.