This class is a wrapper for the PHP's internal expat parser.
It takes an XML file represented by a abstract path name, and starts parsing the file and calling the different "trap" methods inherited from the AbstractParser class.
Those methods then invoke the represenatative methods in the registered handler classes.
author | Andreas Aderhold |
---|---|
copyright | 2001,2002 THYRELL. All rights reserved |
version | $Id$ |
access | public |
package | phing.parser |
__construct(\Reader $reader, string $filename)
The constructor accepts a PhingFile object that represents the filename for the file to be parsed. It sets up php's internal expat parser and options.
string
Filename to read.
\Exception |
if the given argument is not a PhingFile object |
---|
characters(resource $parser, string $data)
This method is called by PHP's internal parser functions and registered in the actual parser implementation.
It gives control to the current active handler object by calling the
characters()
method. That processes the given CDATA.
inherited_from | \AbstractSAXParser::characters() |
---|
resource
php's internal parser handle.
string
the CDATA
\Exception |
- Exceptions may be thrown by the Handler |
---|
endElement(object $parser, string $name)
This method is called by PHP's internal parser funcitons and registered in the actual parser implementation.
It gives control to the current active handler object by calling the
endElement()
method.
inherited_from | \AbstractSAXParser::endElement() |
---|
object
the php's internal parser handle
string
the closing tag name
\Exception |
- Exceptions may be thrown by the Handler |
---|
getLocation() : object
It describes the location of the element within the XML file (line, char)
access | public |
---|
object
the location of the current parserparse() : int
This method needs to be implemented by the child classt that utilizes the concrete parser
access | public |
---|
\ExpatParseException |
if something gone wrong during parsing |
---|---|
\IOException |
if XML file can not be accessed |
int
1 if the parsing succeededparserSetOption(string $opt, $val) : boolean
Must be implemented by the parser class if it should be used.
access | public |
---|
string
the option to set
mixed |
the value to set |
---|
boolean
true if the option could be set, otherwise falsesetHandler(\AbstractHandler $obj)
Usually this is an object using extending "AbstractHandler".
inherited_from | \AbstractSAXParser::setHandler() |
---|
startElement(object $parser, string $name, array $attribs)
This method is called by PHP's internal parser functions and registered in the actual parser implementation. It gives control to the current active handler object by calling the
startElement()
method.
inherited_from | \AbstractSAXParser::startElement() |
---|
object
the php's internal parser handle
string
the open tag name
array
the tag's attributes if any
\Exception |
- Exceptions may be thrown by the Handler |
---|
$handler
inherited_from | \AbstractSAXParser::$$handler |
---|
$buffer
$error_string
$file
$line
$parser : resource
$reader : \Reader