Class SimplePageBuilder

Description

SAX event handler. Maintains a list of open tags and dispatches them as they close.

Located in /libraries/pear/simpletest/page.php (line 23)

SimpleSaxListener
   |
   --SimplePageBuilder
Variable Summary
 mixed $_page
 mixed $_tags
Method Summary
 SimplePageBuilder SimplePageBuilder ()
 boolean addContent (string $text)
 boolean endElement (string $name)
 SimplePage parse ($response $response)
 boolean startElement (string $name, hash $attributes)
 SimpleTag &_createInputTag (hash $attributes)
 SimplePage &_createPage (mixed $response)
 SimpleTag &_createSelectionTag (hash $attributes)
 SimpleTag &_createTag (string $name, hash $attributes)
 void _openTag (SimpleTag &$tag)
Variables
mixed $_page (line 25)
mixed $_tags (line 24)
Methods
Constructor SimplePageBuilder (line 31)

Sets the builder up empty.

  • access: public
SimplePageBuilder SimplePageBuilder ()
addContent (line 130)

Unparsed, but relevant data. The data is added to every open tag.

  • return: False on parse error.
  • access: public
boolean addContent (string $text)
  • string $text: May include unparsed tags.

Redefinition of:
SimpleSaxListener::addContent()
Unparsed, but relevant data.
endElement (line 105)

End of element event.

  • return: False on parse error.
  • access: public
boolean endElement (string $name)
  • string $name: Element name.

Redefinition of:
SimpleSaxListener::endElement()
End of element event.
parse (line 42)

Reads the raw content and send events into the page to be built.

  • return: Newly parsed page.
  • access: public
SimplePage parse ($response $response)
  • $response $response: SimpleHttpResponse Fetched response.
startElement (line 77)

Start of element event. Opens a new tag.

  • return: False on parse error.
  • access: public
boolean startElement (string $name, hash $attributes)
  • string $name: Element name.
  • hash $attributes: Attributes without content are marked as true.

Redefinition of:
SimpleSaxListener::startElement()
Start of element event.
_addContentTagToOpenTags (line 145)

Parsed relevant data. The parsed tag is added to every open tag.

  • access: private
void _addContentTagToOpenTags (SimpleTag &$tag)
_createInputTag (line 218)

Factory for input tags.

  • return: Tag object.
  • access: protected
SimpleTag &_createInputTag (hash $attributes)
  • hash $attributes: Element attributes.
_createPage (line 55)

Creates an empty page.

  • return: New unparsed page.
  • access: protected
SimplePage &_createPage (mixed $response)
_createParser (line 65)

Creates the parser used with the builder.

  • return: Parser to generate events for the builder.
  • access: protected
SimpleSaxParser &_createParser ()
_createSelectionTag (line 205)

Factory for selection fields.

  • return: Tag object.
  • access: protected
SimpleTag &_createSelectionTag (hash $attributes)
  • hash $attributes: Element attributes.
_createTag (line 178)

Factory for the tag objects. Creates the appropriate tag object for the incoming tag name.

  • return: Tag object.
  • access: protected
SimpleTag &_createTag (string $name, hash $attributes)
  • string $name: HTML tag name.
  • hash $attributes: Element attributes.
_openTag (line 162)

Opens a tag for receiving content. Multiple tags will be receiving input at the same time.

  • access: private
void _openTag (SimpleTag &$tag)

Inherited Methods

Inherited From SimpleSaxListener

 SimpleSaxListener::SimpleSaxListener()
 SimpleSaxListener::addContent()
 SimpleSaxListener::endElement()
 SimpleSaxListener::startElement()

Documentation generated on Fri, 3 Dec 2004 12:27:10 +0000 by phpDocumentor 1.3.0RC3