# 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

Package: phing\parser

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

Children
  \ExpatParser
Author
  Andreas Aderhold
Author
  Hans Lellelid
Copyright
  2001,2002 THYRELL. All rights reserved
Version
  $Revision: 912 $

### Properties

`$handler= ''`

The AbstractHandler object.

Details

Type
  n/a

### Methods

`__construct( ) : void`

Constructs a SAX parser

`characters( resource $parser, string $data ) : void`

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

Throws

Exception | Description
--- | ---
\Exception | - Exceptions may be thrown by the Handler

`endElement( object $parser, string $name ) : void`

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

Throws

Exception | Description
--- | ---
\Exception | - Exceptions may be thrown by the Handler

`parse( ) : void`
abstract

Entrypoint for parser. This method needs to be implemented by the child classt that utilizes the concrete parser

`parserSetOption( $opt, $val ) : void`
abstract

Sets 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 ) : void`

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 ) : void`

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

Throws

Exception | Description
--- | ---
\Exception | - Exceptions may be thrown by the Handler

Documentation was generated by DocBlox 0.17.1.