Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
XSLTransformer Class Reference

Public Member Functions

_transformExternal (&$xml, $xmlType, &$xsl, $xslType, $resultType)
 
_transformPHP (&$xml, $xmlType, &$xsl, $xslType, $resultType)
 
 addError ($error)
 
 getProcessor ()
 
 setParameters ($parameters)
 
 setRegisterPHPFunctions ($flag)
 
transform (&$xml, $xmlType, &$xsl, $xslType, $resultType)
 
 transformFiles ($xmlFile, $xslFile)
 
 transformStrings ($xml, $xsl)
 
 XSLTransformer ()
 

Public Attributes

 $errors
 
 $externalCommand
 
 $externalParameterSnippet
 
 $parameters
 
 $processor
 
 $registerPHPFunctions
 

Detailed Description

Wrapper class for running XSL transformations using PHP 4.x or 5.x.

Definition at line 24 of file XSLTransformer.inc.php.

Member Function Documentation

& XSLTransformer::_transformExternal ( $xml,
  $xmlType,
$xsl,
  $xslType,
  $resultType 
)

Use external programs to do the XSL transformation

Parameters
$xmlmixed
$xmlTypeinteger
$xslmixed
$xslTypeinteger
$resultTypeinteger
Returns
mixed return type depends on the $returnType parameter and can be DOMDocument or string. Returns boolean "false" on error.

Definition at line 191 of file XSLTransformer.inc.php.

& XSLTransformer::_transformPHP ( $xml,
  $xmlType,
$xsl,
  $xslType,
  $resultType 
)

Use PHP5's DOMDocument and XSLTProcessor to do the transformation

Parameters
$xmlmixed
$xmlTypeinteger
$xslmixed
$xslTypeinteger
$resultTypeinteger
Returns
mixed return type depends on the $returnType parameter and can be DOMDocument or string. Returns boolean "false" on error.

Definition at line 258 of file XSLTransformer.inc.php.

XSLTransformer::addError (   $error)

Add an error to the current error list

Parameters
$errorstring

Definition at line 354 of file XSLTransformer.inc.php.

XSLTransformer::getProcessor ( )

Get the processor type

Returns
string

Definition at line 97 of file XSLTransformer.inc.php.

XSLTransformer::setParameters (   $parameters)

Set the parameter list for internal processors.

Parameters
$parametersarray

Definition at line 105 of file XSLTransformer.inc.php.

XSLTransformer::setRegisterPHPFunctions (   $flag)

Set the registerPHPFunctions setting on or off.

Parameters
$flagboolean

Definition at line 113 of file XSLTransformer.inc.php.

& XSLTransformer::transform ( $xml,
  $xmlType,
$xsl,
  $xslType,
  $resultType 
)

Apply an XSLT transform to a given XML and XSL. Both parameters can be either strings, files or DOM objects.

Parameters
$xmlmixed
$xmlTypeinteger
$xslmixed
$xslTypeinteger
$resultTypeinteger
Returns
mixed return type depends on the $returnType parameter and can be DOMDocument or string. The method returns a boolean value of false if the transformation fails for some reason.

Definition at line 151 of file XSLTransformer.inc.php.

XSLTransformer::transformFiles (   $xmlFile,
  $xslFile 
)

Apply an XSLT transform to a given XML and XSL source files

Parameters
$xmlFilestring absolute pathname to the XML source file
$xslFilestring absolute pathname to the XSL stylesheet
Returns
string containing the transformed XML output, or false on error

Definition at line 125 of file XSLTransformer.inc.php.

XSLTransformer::transformStrings (   $xml,
  $xsl 
)

Apply an XSLT transform to a given XML and XSL strings

Parameters
$xmlstring containing source XML
$xslstring containing source XSL
Returns
string containing the transformed XML output, or false on error

Definition at line 135 of file XSLTransformer.inc.php.

XSLTransformer::XSLTransformer ( )

Constructor. Initialize transformer and set parser options.

Returns
boolean returns false if no XSLT processor could be created

Definition at line 67 of file XSLTransformer.inc.php.

Member Data Documentation

array XSLTransformer::$errors

List of error strings

Definition at line 60 of file XSLTransformer.inc.php.

string XSLTransformer::$externalCommand

containing external XSLT shell command

Definition at line 36 of file XSLTransformer.inc.php.

string XSLTransformer::$externalParameterSnippet

containing external XSLT shell arguments for parameters

Definition at line 42 of file XSLTransformer.inc.php.

array XSLTransformer::$parameters

of parameters to pass to XSL (built-in libraries only)

Definition at line 48 of file XSLTransformer.inc.php.

string XSLTransformer::$processor

determining the XSLT processor to use for this object

Definition at line 30 of file XSLTransformer.inc.php.

array XSLTransformer::$registerPHPFunctions

of PHP functions to allow in XSL (PHP5 built-in only)

Definition at line 54 of file XSLTransformer.inc.php.


The documentation for this class was generated from the following file: