$folding = true
[line 143]
Whether to do case folding
If set to true, all tag and attribute names will be converted to UPPER CASE.
$fp =
[line 133]
File handle if parsing from a file
$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'
)
[line 157]
Mapping from expat handler function to class method.
$mode =
[line 150]
Mode of operation, one of "event" or "func"
$parser =
[line 126]
XML parser handle
$srcenc =
[line 171]
source encoding
$tgtenc =
[line 178]
target encoding
__construct (Constructor) [line 207]
XML_Parser __construct(
[string
$srcenc = null], [string
$mode = 'event'], [string
$tgtenc = null])
PHP5 constructor
Overridden in child classes as:
- XML_Parser_Simple::__construct()
- Creates an XML parser.
Parameters:
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
endHandler [line 676]
null endHandler(
mixed
$xp, mixed
$elem)
abstract method signature for End Handler
Parameters:
mixed
$xp
—
??
mixed
$elem
—
??
free [line 570]
XML_Parser::free()
Free the internal resources associated with the parser
funcEndHandler [line 635]
void funcEndHandler(
mixed
$xp, mixed
$elem)
derives and calls the End Handler function
Parameters:
mixed
$xp
—
??
mixed
$elem
—
??
funcStartHandler [line 612]
void funcStartHandler(
mixed
$xp, mixed
$elem, mixed
$attribs)
derives and calls the Start Handler function
Parameters:
mixed
$xp
—
??
mixed
$elem
—
??
mixed
$attribs
—
??
parse [line 482]
Central parsing function.
- Return: returns true on success, or a PEAR_Error otherwise
- Access: public
parseString [line 545]
bool|PEAR_Error parseString(
string
$data, [boolean
$eof = false])
XML_Parser::parseString()
Parses a string.
- Return: true on success or a PEAR Error
- See: _parseString()
- Throws: XML_Parser_Error
Parameters:
string
$data
—
XML data
boolean
$eof
—
If set and TRUE, data is the last piece of data sent in this parser
raiseError [line 593]
XML_Parser::raiseError()
Throws a XML_Parser_Error
- Return: reference to the error object
Parameters:
string
$msg
—
the error message
integer
$ecode
—
the error message code
reset [line 373]
Reset the parser.
This allows you to use one parser instance to parse multiple XML documents.
- Return: true on success, PEAR_Error otherwise
- Access: public
Overridden in child classes as:
- XML_Parser_Simple::reset()
- Reset the parser.
setHandlerObj [line 262]
boolean setHandlerObj(
$obj, object
&$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.
- Return: will always return true
- Since: v1.2.0beta3
- Access: public
Parameters:
object
&$obj
—
object to handle the events
$obj
—
setInput [line 452]
mixed setInput(
mixed
$fp)
Sets the file handle to use with parse().
You should use setInputFile() or setInputString() if you pass a string
Parameters:
mixed
$fp
—
Can be either a resource returned from fopen(), a URL, a local filename or a string.
setInputFile [line 395]
resource setInputFile(
string
$file)
Sets the input xml file to be parsed
Parameters:
string
$file
—
Filename (full path)
setInputString [line 429]
null setInputString(
string
$data)
XML_Parser::setInputString()
Sets the xml input from a string
Parameters:
string
$data
—
a string containing the XML document
setMode [line 235]
boolean|object setMode(
string
$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.
- Return: true on success, PEAR_Error otherwise
- Access: public
Parameters:
string
$mode
—
mode, either 'func' or 'event'
startHandler [line 659]
null startHandler(
mixed
$xp, mixed
$elem, mixed
&$attribs)
abstract method signature for Start Handler
Parameters:
mixed
$xp
—
??
mixed
$elem
—
??
mixed
&$attribs
—
??