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


Public Member Functions | |
| XML_Parser ($srcenc=null, $mode= 'event', $tgtenc=null) | |
| __construct ($srcenc=null, $mode= 'event', $tgtenc=null) | |
| setMode ($mode) | |
| setHandlerObj (&$obj) | |
| _initHandlers () | |
| _create () | |
| reset () | |
| setInputFile ($file) | |
| setInputString ($data) | |
| setInput ($fp) | |
| parse () | |
| _parseString ($data, $eof=false) | |
| parseString ($data, $eof=false) | |
| free () | |
| & | raiseError ($msg=null, $ecode=0) |
| funcStartHandler ($xp, $elem, $attribs) | |
| funcEndHandler ($xp, $elem) | |
| startHandler ($xp, $elem, &$attribs) | |
| endHandler ($xp, $elem) | |
Data Fields | |
| $parser | |
| $fp | |
| $folding = true | |
| $mode | |
| $handler | |
| $srcenc | |
| $tgtenc | |
| $_handlerObj | |
| $_validEncodings = array('ISO-8859-1', 'UTF-8', 'US-ASCII') | |
Definition at line 116 of file Parser.php.
| __construct | ( | $ | srcenc = null, |
| $ | mode = 'event', |
||
| $ | tgtenc = null |
||
| ) |
PHP5 constructor
| string | $srcenc | source charset encoding, use NULL (default) to use whatever the document specifies |
| string | $mode | how this parser object should work, "event" for startelement/endelement-type events, "func" to have it call functions named after elements |
| string | $tgtenc | a valid target encoding |
Definition at line 227 of file Parser.php.


| _create | ( | ) |
create the XML parser resource
Has been moved from the constructor to avoid problems with object references.
Furthermore it allows us returning an error if something fails.
NOTE: uses '@' error suppresion in this method
Definition at line 349 of file Parser.php.


| _initHandlers | ( | ) |
Init the element handlers
set additional handlers for character data, entities, etc.
Reimplemented in XML_Parser_Simple.
Definition at line 294 of file Parser.php.


| _parseString | ( | $ | data, |
| $ | eof = false |
||
| ) |
| string | $data | data |
| bool | $eof | end-of-file flag |
Definition at line 544 of file Parser.php.

| endHandler | ( | $ | xp, |
| $ | elem | ||
| ) |
abstract method signature for End Handler
| mixed | $xp | ?? |
| mixed | $elem | ?? |
Reimplemented in XML_Parser_Simple, and BasicXmlParser.
Definition at line 696 of file Parser.php.
| free | ( | ) |
Free the internal resources associated with the parser
Definition at line 590 of file Parser.php.

| funcEndHandler | ( | $ | xp, |
| $ | elem | ||
| ) |
derives and calls the End Handler function
| mixed | $xp | ?? |
| mixed | $elem | ?? |
Definition at line 655 of file Parser.php.
| funcStartHandler | ( | $ | xp, |
| $ | elem, | ||
| $ | attribs | ||
| ) |
derives and calls the Start Handler function
| mixed | $xp | ?? |
| mixed | $elem | ?? |
| mixed | $attribs | ?? |
Definition at line 632 of file Parser.php.
| parse | ( | ) |
Central parsing function.
reset the parser
Definition at line 502 of file Parser.php.

| parseString | ( | $ | data, |
| $ | eof = false |
||
| ) |
Parses a string.
| string | $data | XML data |
| boolean | $eof | If set and TRUE, data is the last piece of data sent in this parser |
| XML_Parser_Error |
Definition at line 565 of file Parser.php.

| & raiseError | ( | $ | msg = null, |
| $ | ecode = 0 |
||
| ) |
Throws a XML_Parser_Error
| string | $msg | the error message |
| integer | $ecode | the error message code |
Definition at line 613 of file Parser.php.

| reset | ( | ) |
Reset the parser.
This allows you to use one parser instance to parse multiple XML documents.
public
Reimplemented in XML_Parser_Simple.
Definition at line 393 of file Parser.php.


| setHandlerObj | ( | &$ | obj | ) |
Sets the object, that will handle the XML events
This allows you to create a handler object independent of the parser object that you are using and easily switch the underlying parser.
If no object will be set, XML_Parser assumes that you extend this class and handle the events in $this.
| object | &$obj | object to handle the events |
Definition at line 282 of file Parser.php.
| setInput | ( | $ | fp | ) |
Sets the file handle to use with parse().
You should use setInputFile() or setInputString() if you pass a string
| mixed | $fp | Can be either a resource returned from fopen(), a URL, a local filename or a string. |
Definition at line 472 of file Parser.php.

| setInputFile | ( | $ | file | ) |
Sets the input xml file to be parsed
| string | $file | Filename (full path) |
| XML_Parser_Error |
check, if file is a remote file
Definition at line 415 of file Parser.php.


| setInputString | ( | $ | data | ) |
Sets the xml input from a string
| string | $data | a string containing the XML document |
Definition at line 449 of file Parser.php.
| setMode | ( | $ | mode | ) |
Sets the mode of the parser.
Possible modes are:
You can set the mode using the second parameter in the constructor.
This method is only needed, when switching to a new mode at a later point.
| string | $mode | mode, either 'func' or 'event' |
Definition at line 255 of file Parser.php.

| startHandler | ( | $ | xp, |
| $ | elem, | ||
| &$ | attribs | ||
| ) |
abstract method signature for Start Handler
| mixed | $xp | ?? |
| mixed | $elem | ?? |
| mixed | &$attribs | ?? |
Reimplemented in XML_Parser_Simple.
Definition at line 679 of file Parser.php.
| XML_Parser | ( | $ | 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 startelement/endelement-type events, "func" to have it call functions named after elements |
| string | $tgtenc | a valid target encoding |
Definition at line 210 of file Parser.php.


| $_handlerObj |
Definition at line 185 of file Parser.php.
| $_validEncodings = array('ISO-8859-1', 'UTF-8', 'US-ASCII') |
Definition at line 192 of file Parser.php.
| $folding = true |
Definition at line 143 of file Parser.php.
| $fp |
Definition at line 133 of file Parser.php.
| $handler |
array( 'character_data_handler' => 'cdataHandler', 'default_handler' => 'defaultHandler', 'processing_instruction_handler' => 'piHandler', 'unparsed_entity_decl_handler' => 'unparsedHandler', 'notation_decl_handler' => 'notationHandler', 'external_entity_ref_handler' => 'entityrefHandler' )
Reimplemented in XML_Parser_Simple.
Definition at line 157 of file Parser.php.
| $mode |
Definition at line 150 of file Parser.php.
| $parser |
Definition at line 126 of file Parser.php.
| $srcenc |
Definition at line 171 of file Parser.php.
| $tgtenc |
Definition at line 178 of file Parser.php.