Class SimpleSaxParser

Description

Converts HTML tokens into selected SAX events.

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


	
			
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 446)
mixed $_current_attribute (line 447)
mixed $_lexer (line 443)

Redefined in descendants as:
mixed $_listener (line 444)
mixed $_tag (line 445)
Methods
Constructor SimpleSaxParser (line 454)

Sets the listener.

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

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 605)

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 638)

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 577)

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 649)

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 480)

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 660)

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 469)

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 553)

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

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

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

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

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

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

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 670)

Decodes any HTML entities.

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

List of parsed tags. Others are ignored.

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

Documentation generated on Fri, 24 Dec 2004 13:02:59 +0000 by phpDocumentor 1.3.0RC3