# classes/phing/parser/AbstractSAXParser.php

The abstract SAX parser class.

This class represents a SAX parser. It is a abstract calss that must be implemented by the real parser that must extend this class

author
  Andreas Aderhold
author
  Hans Lellelid
copyright
  2001,2002 THYRELL. All rights reserved
package
  phing.parser
version
  $Revision: 912 $

## \AbstractSAXParser
jump to top

The abstract SAX parser class.

This class represents a SAX parser. It is a abstract calss that must be implemented by the real parser that must extend this class

author
  Andreas Aderhold
author
  Hans Lellelid
copyright
  2001,2002 THYRELL. All rights reserved
package
  phing.parser
version
  $Revision: 912 $

### Properties

`$handler= ''`

The AbstractHandler object.

Details

Type

### Methods

`__construct( ) :`
Constructs a SAX parser
`characters( resource $parser, string $data ) :`
Method that gets invoked when the parser runs over CDATA.

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.

Parameters

Name | Type | Description
--- | --- | ---
$parser | resource | php's internal parser handle.
$data | string | the CDATA

Details

throws
  - Exceptions may be thrown by the Handler

`endElement( object $parser, string $name ) :`
Method that gets invoked when the parser runs over a XML close element.

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.

Parameters

Name | Type | Description
--- | --- | ---
$parser | object | the php's internal parser handle
$name | string | the closing tag name

Details

throws
  - Exceptions may be thrown by the Handler

`parse( ) :`
abstractEntrypoint for parser. This method needs to be implemented by the child classt that utilizes the concrete parser
`parserSetOption( $opt, $val ) :`
abstractSets options for PHP interal parser. Must be implemented by the parser class if it should be used.
Parameters

Name | Type | Description
--- | --- | ---
$opt |  |
$val |  |

`setHandler( \AbstractHandler $obj ) :`
Sets the current element handler object for this parser. Usually this is an object using extending "AbstractHandler".
Parameters

Name | Type | Description
--- | --- | ---
$obj | \AbstractHandler | The handler object.

`startElement( object $parser, string $name, array $attribs ) :`
Method that gets invoked when the parser runs over a XML start element.

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.

Parameters

Name | Type | Description
--- | --- | ---
$parser | object | the php's internal parser handle
$name | string | the open tag name
$attribs | array | the tag's attributes if any

Details

throws
  - Exceptions may be thrown by the Handler

Documentation was generated by DocBlox 0.13.1.