Class Scenario_Renderer_Xml

Description

XML / XSLT resultset renderer.

Renderer class that outputs in either raw XML or translates it using either a supplied or built in XSL file. Currently supported XSL parameters: 'html'.

  • copyright: Copyright (c) 2010 TK Studios. (http://www.tkstudios.com)
  • license: New BSD License

Located in /Scenario/Renderer/Xml.php (line 37)

Scenario_Renderer_Abstract
   |
   --Scenario_Renderer_Xml
Class Constant Summary
 AS_HTML = 'html'
 AS_XML = 'xml'
Method Summary
Scenario_Renderer_Xml __construct ([string $stylesheet = self::AS_XML])
mixed getTranslator ()
DOMDocument getXslt (string $name)
string renderSet (Scenario_ResultSet $results, [bool $capture = false])
DOMDocument resultsAsXml (Scenario_Result|Scenario_ResultSet $resultSet)
void setTranslator ( $translator, mixed $name)
string translate ( $xml,  $xslt)
Variables
Methods
Constructor __construct (line 46)
  • access: public
Scenario_Renderer_Xml __construct ([string $stylesheet = self::AS_XML])
  • string $stylesheet

Redefinition of:
Scenario_Renderer_Abstract::__construct()
getTranslator (line 77)

Returns the current translator (DOMDocument or string)

  • access: public
mixed getTranslator ()
getXslt (line 268)

Load an XSL file from Xslt subdir.

  • access: public
DOMDocument getXslt (string $name)
  • string $name: Name of the XSL file to load. Should be a filename within Scenario/Renderer/Xslt/
renderSet (line 91)

Render a Scenario_ResultSet

Renders a result set in XML. To render multiple experiments, merge the collections, or render them individually.

  • return: The rendered result document as a string.
  • access: public
string renderSet (Scenario_ResultSet $results, [bool $capture = false])
  • Scenario_ResultSet $results: The resultset to render.
  • bool $capture: (optional) Whether to capture the results rather than render them to output.

Redefinition of:
Scenario_Renderer_Abstract::renderSet()
renderSet
resultsAsXml (line 139)

Translates a result or resultset into an XML DOMDocument.

  • access: public
DOMDocument resultsAsXml (Scenario_Result|Scenario_ResultSet $resultSet)
setTranslator (line 61)

Sets the xslt parameter

Alias for setParam('xslt',$translator). If the translator is an instance of DOMDocument it will be used in the XML translation by itself. If $translator starts with a slash, it will be interpreted as a path. Otherwise, the file is assumed to reside within the Scenario/Reporter/Xslt/ folder, as {$translator}.xsl

  • access: public
void setTranslator ( $translator, mixed $name)
  • mixed $name: Can be set to either a string or a DOMDocument (XSL)
  • $translator
translate (line 125)

Translates the provided xml and xsl DOMDocuments to string

  • return: Output of the translation.
  • access: public
string translate ( $xml,  $xslt)
  • DOMDocument $xml: XML to use in the translation.
  • DOMDocument $xslt: XSL Stylesheet to apply to the XML.

Inherited Methods

Inherited From Scenario_Renderer_Abstract

Scenario_Renderer_Abstract::__construct()
Scenario_Renderer_Abstract::clearParam()
Scenario_Renderer_Abstract::getParam()
Scenario_Renderer_Abstract::getParams()
Scenario_Renderer_Abstract::renderSet()
Scenario_Renderer_Abstract::setParam()
Scenario_Renderer_Abstract::setParams()
Class Constants
AS_HTML = 'html' (line 39)
AS_XML = 'xml' (line 40)

Documentation generated on Sat, 23 Oct 2010 18:10:50 -0400 by phpDocumentor 1.4.3