Class SimpleSaxParser

Description

Converts HTML tokens into selected SAX events.

Located in /libraries/pear/simpletest/parser.php (line 448)


	
			
Direct descendents
Class Description
 class TestSimpleSaxParser Converts HTML tokens into selected SAX events.
Variable Summary
 mixed $_attributes
 mixed $_lexer
 mixed $_listener
 mixed $_tag
Method Summary
 SimpleSaxParser SimpleSaxParser (SimpleSaxListener &$listener)
 boolean acceptAttributeToken (string $token, integer $event)
 boolean acceptEndToken (string $token, integer $event)
 boolean acceptEntityToken (string $token, integer $event)
 boolean acceptStartToken (string $token, integer $event)
 boolean acceptTextToken (string $token, integer $event)
 boolean ignore (string $token, integer $event)
 boolean parse (string $raw)
 void _addInTagTokens (SimpleLexer &$lexer)
 void _addSkipping (SimpleLexer &$lexer)
 void _addTag (SimpleLexer &$lexer, string $tag)
 string _decodeHtml (string $html)
 array _getParsedTags ()
Variables
mixed $_attributes (line 452)
mixed $_current_attribute (line 453)
mixed $_lexer (line 449)

Redefined in descendants as:
mixed $_listener (line 450)
mixed $_tag (line 451)
Methods
Constructor SimpleSaxParser (line 460)

Sets the listener.

  • access: public
SimpleSaxParser SimpleSaxParser (SimpleSaxListener &$listener)
acceptAttributeToken (line 625)

Part of the tag data.

  • return: False if parse error.
  • access: public
boolean acceptAttributeToken (string $token, integer $event)
  • string $token: Incoming characters.
  • integer $event: Lexer event type.
acceptEndToken (line 611)

Accepts a token from the end tag mode.

The element name is converted to lower case.

  • return: False if parse error.
  • access: public
boolean acceptEndToken (string $token, integer $event)
  • string $token: Incoming characters.
  • integer $event: Lexer event type.
acceptEntityToken (line 644)

A character entity.

  • return: False if parse error.
  • access: public
boolean acceptEntityToken (string $token, integer $event)
  • string $token: Incoming characters.
  • integer $event: Lexer event type.
acceptStartToken (line 583)

Accepts a token from the tag mode. 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.

  • return: False if parse error.
  • access: public
boolean acceptStartToken (string $token, integer $event)
  • string $token: Incoming characters.
  • integer $event: Lexer event type.
acceptTextToken (line 655)

Character data between tags regarded as important.

  • return: False if parse error.
  • access: public
boolean acceptTextToken (string $token, integer $event)
  • string $token: Incoming characters.
  • integer $event: Lexer event type.
createLexer (line 486)

Sets up the matching lexer. Starts in 'text' mode.

  • return: Lexer suitable for this parser.
  • static:
  • access: public
SimpleLexer &createLexer (SimpleSaxParser &$parser)

Redefined in descendants as:
ignore (line 666)

Incoming data to be ignored.

  • return: False if parse error.
  • access: public
boolean ignore (string $token, integer $event)
  • string $token: Incoming characters.
  • integer $event: Lexer event type.
parse (line 475)

Runs the content through the lexer which should call back to the acceptors.

  • return: False if parse error.
  • access: public
boolean parse (string $raw)
  • string $raw: Page text to parse.
_addAttributeTokens (line 559)

Matches attributes that are either single quoted, double quoted or unquoted.

  • static:
  • access: private
void _addAttributeTokens (SimpleLexer &$lexer)
_addInTagTokens (line 545)

Pattern matches to parse the inside of a tag including the attributes and their quoting.

  • static:
  • access: private
void _addInTagTokens (SimpleLexer &$lexer)
_addSkipping (line 514)

The lexer has to skip certain sections such as server code, client code and styles.

  • static:
  • access: private
void _addSkipping (SimpleLexer &$lexer)
_addTag (line 533)

Pattern matches to start and end a tag.

  • static:
  • access: private
void _addTag (SimpleLexer &$lexer, string $tag)
  • SimpleLexer $lexer: Lexer to add patterns to.
  • string $tag: Name of tag to scan for.
_decodeHtml (line 676)

Decodes any HTML entities.

  • return: Outgoing plain text.
  • access: private
string _decodeHtml (string $html)
  • string $html: Incoming HTML.
_getParsedTags (line 502)

List of parsed tags. Others are ignored.

  • return: List of searched for tags.
  • access: private
array _getParsedTags ()

Documentation generated on Fri, 11 Feb 2005 18:13:48 +0000 by phpDocumentor 1.3.0RC3