PHP Class SimpleHtmlSaxParser, simpletest

Datei anzeigen Open project: simpletest/simpletest Class Usage Examples

Public Methods

Method Description
__construct ( SimplePhpPageBuilder $listener ) Sets the listener.
acceptAttributeToken ( string $token, integer $event ) : boolean Part of the tag data.
acceptEndToken ( string $token, integer $event ) : boolean Accepts a token from the end tag mode. The element name is converted to lower case.
acceptEntityToken ( string $token, integer $event ) : boolean A character entity.
acceptStartToken ( string $token, integer $event ) : boolean Accepts a token from the tag mode.
acceptTextToken ( string $token, integer $event ) : boolean Character data between tags regarded as important.
createLexer ( SimpleSaxParser &$parser ) : SimpleLexer Sets up the matching lexer. Starts in 'text' mode.
ignore ( string $token, integer $event ) : boolean Incoming data to be ignored.
parse ( string $raw ) : boolean Runs the content through the lexer which should call back to the acceptors.

Method Details

__construct() public method

Sets the listener.
public __construct ( SimplePhpPageBuilder $listener )
$listener SimplePhpPageBuilder SAX event handler.

acceptAttributeToken() public method

Part of the tag data.
public acceptAttributeToken ( string $token, integer $event ) : boolean
$token string Incoming characters.
$event integer Lexer event type.
return boolean False if parse error.

acceptEndToken() public method

Accepts a token from the end tag mode. The element name is converted to lower case.
public acceptEndToken ( string $token, integer $event ) : boolean
$token string Incoming characters.
$event integer Lexer event type.
return boolean False if parse error.

acceptEntityToken() public method

A character entity.
public acceptEntityToken ( string $token, integer $event ) : boolean
$token string Incoming characters.
$event integer Lexer event type.
return boolean False if parse error.

acceptStartToken() public method

If the starting element completes then the element is dispatched and the current attributes set back to empty. The element or attribute name is converted to lower case.
public acceptStartToken ( string $token, integer $event ) : boolean
$token string Incoming characters.
$event integer Lexer event type.
return boolean False if parse error.

acceptTextToken() public method

Character data between tags regarded as important.
public acceptTextToken ( string $token, integer $event ) : boolean
$token string Incoming characters.
$event integer Lexer event type.
return boolean False if parse error.

createLexer() public static method

Sets up the matching lexer. Starts in 'text' mode.
public static createLexer ( SimpleSaxParser &$parser ) : SimpleLexer
$parser SimpleSaxParser Event generator, usually $self.
return SimpleLexer Lexer suitable for this parser.

ignore() public method

Incoming data to be ignored.
public ignore ( string $token, integer $event ) : boolean
$token string Incoming characters.
$event integer Lexer event type.
return boolean False if parse error.

parse() public method

Runs the content through the lexer which should call back to the acceptors.
public parse ( string $raw ) : boolean
$raw string Page text to parse.
return boolean False if parse error.