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
Methods

__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.
| Name | Type | Description |
|---|---|---|
| $reader | \Reader | The Reader Object that is to be read from. |
| $filename | string | Filename to read. |
- throws
- if the given argument is not a PhingFile object

getLocation(
)
:
objectReturns the location object of the current parsed element. It describes
the location of the element within the XML file (line, char)
| Type | Description |
|---|---|
| object |
- access
- public

parse(
)
:
intStarts the parsing process.
| Type | Description |
|---|---|
| int |
- access
- public
- throws
- if something gone wrong during parsing
- throws
- if XML file can not be accessed