classes/phing/parser/ExpatParser.php

\ExpatParser

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.

Extends from
\AbstractSAXParser
access
public
author
Andreas Aderhold
copyright
© 2001,2002 THYRELL. All rights reserved
package
phing.parser
version
$Revision: 526 $ $Date: 2009-08-11 14:11:17 +0200 (Tue, 11 Aug 2009) $

Properties

Propertyprivate  $buffer= '4096'
Default value4096Details
Type
Propertyprivate  $error_string= ''
Details
Type
Propertyprivate  $file= ''
Details
Type
Propertyprivate  $line= '0'
Default value0Details
Type
Propertyprivate\Location  $location= ''

Current cursor pos in XML file.
Details
Type
\Location
Propertyprivateresource  $parser= ''

Details
Type
resource
Propertyprivate\Reader  $reader= ''

Details
Type
\Reader

Methods

methodpublic  __construct( \Reader $reader, string $filename = null ) :
Constructs a new ExpatParser object.

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.

Parameters
Name Type Description
$reader \Reader The Reader Object that is to be read from.
$filename string Filename to read.
Details
throws
if the given argument is not a PhingFile object
methodpublic  getLocation( ) : object
Returns the location object of the current parsed element. It describes the location of the element within the XML file (line, char)
Returns
Type Description
object
Details
access
public
methodpublic  parse( ) : int
Starts the parsing process.
Returns
Type Description
int
Details
access
public
throws
if something gone wrong during parsing
throws
if XML file can not be accessed
methodpublic  parserSetOption( string $opt,  $val ) : boolean
Override PHP's parser default settings, created in the constructor.
Parameters
Name Type Description
$opt string the option to set
$val
Returns
Type Description
boolean
Details
access
public
throws
the value to set
Documentation was generated by DocBlox 0.13.1.