phing-parser
[ class tree: phing-parser ] [ index: phing-parser ] [ all elements ]

Class: ExpatParser

Source Location: /parser/ExpatParser.php

Class Overview

AbstractSAXParser
   |
   --ExpatParser

This class is a wrapper for the PHP's internal expat parser.


Author(s):

Version:

  • $Revision: 526 $ $Date: 2009-08-11 14:11:17 +0200 (Tue, 11 Aug 2009) $

Copyright:

  • © 2001,2002 THYRELL. All rights reserved

Methods


Inherited Variables

Inherited Methods

Class: AbstractSAXParser

AbstractSAXParser::__construct()
Constructs a SAX parser
AbstractSAXParser::characters()
Method that gets invoked when the parser runs over CDATA.
AbstractSAXParser::endElement()
Method that gets invoked when the parser runs over a XML close element.
AbstractSAXParser::parse()
Entrypoint for parser. This method needs to be implemented by the
AbstractSAXParser::parserSetOption()
Sets options for PHP interal parser. Must be implemented by the parser class if it should be used.
AbstractSAXParser::setHandler()
Sets the current element handler object for this parser. Usually this is an object using extending "AbstractHandler".
AbstractSAXParser::startElement()
Method that gets invoked when the parser runs over a XML start element.

Class Details

[line 44]
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.




Tags:

author:  Andreas Aderhold <andi@binarycloud.com>
version:  $Revision: 526 $ $Date: 2009-08-11 14:11:17 +0200 (Tue, 11 Aug 2009) $
copyright:  © 2001,2002 THYRELL. All rights reserved
access:  public


[ Top ]


Class Methods


constructor __construct [line 74]

ExpatParser __construct( $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.




Tags:

throws:  Exception if the given argument is not a PhingFile object


Overrides AbstractSAXParser::__construct() (Constructs a SAX parser)

Parameters:

Reader   $reader   The Reader Object that is to be read from.
string   $filename   Filename to read.

[ Top ]

method getLocation [line 107]

object the getLocation( )

Returns the location object of the current parsed element. It describes the location of the element within the XML file (line, char)



Tags:

return:  location of the current parser
access:  public


[ Top ]

method parse [line 126]

int parse( string 0)

Starts the parsing process.



Tags:

return:  1 if the parsing succeeded
throws:  IOException if XML file can not be accessed
throws:  ExpatParseException if something gone wrong during parsing
access:  public


Overrides AbstractSAXParser::parse() (Entrypoint for parser. This method needs to be implemented by the)

Parameters:

string   0   the option to set

[ Top ]

method parserSetOption [line 96]

boolean parserSetOption( string $opt, $val)

Override PHP's parser default settings, created in the constructor.



Tags:

return:  true if the option could be set, otherwise false
throws:  mixed the value to set
access:  public


Overrides AbstractSAXParser::parserSetOption() (Sets options for PHP interal parser. Must be implemented by the parser class if it should be used.)

Parameters:

string   $opt   the option to set
   $val  

[ Top ]


Documentation generated on Mon, 19 Oct 2009 10:50:52 +0200 by phpDocumentor 1.4.3