contenido\classes\class.xsltprocessor.php

Show: PublicProtectedPrivateinherited
Table of Contents
Project: Contenido Content Management System

Description: XSLT_Processor class

Requirements:

Author
Jan Lengowski  
Con_php_req
5.0  
Copyright
four for business AG  
License
http://www.contenido.org/license/LIZENZ.txt  
Link
http://www.4fb.de  
Link
http://www.contenido.org  
Package
4fb_XML  
Since
file available since contenido release <= 4.6 {@internal created unknown modified 2008-06-30, Dominik Ziegler, add security fix $Id: class.xsltprocessor.php 387 2008-06-30 10:01:05Z timo.trautmann $: }}  
Version
1.0.0  

\XsltProcessor

Package: Default
XSLT_Processor

Wrapper class for the Sablotron XSLT extension

!!! REQUIRES Installed Sablotron to run !!!

Example:

$xslt = new XSLT_Processor;

$xslt->setXmlFile("foo.xml"); $xslt->setXslFile("bar.xslt");

$html = $xslt->process();

Properties

>VPropertypublicarray $arguments = array()
XSLT Process arguments array
Default valuearray()Details
Type
array
Access
private  
>VPropertypublicbool $autofree = true
XSML Processor auto-free
Default valuetrueDetails
Type
bool
Access
private  
>VPropertypublicint $errno = 0
Error number
Default value0Details
Type
int
Access
private  
>VPropertypublicstring $error = ""
Error message string
Default value""Details
Type
string
Access
private  
>VPropertypublicarray $parameters = array()
XSLT Process parameters array
Default valuearray()Details
Type
array
Access
private  
>VPropertypublicobject $processor
XSLT Processor
Details
Type
object
Access
private  
>VPropertypublicstring $result = ""
The result of the XSLT Transformation
Default value""Details
Type
string
Access
private  
>VPropertypublicstring $xml = ""
The XML String for the Transformation
Default value""Details
Type
string
Access
private  
>VPropertypublicstring $xslt = ""
The XSLT String for the Transformation
Default value""Details
Type
string
Access
private  

Methods

methodpublicXsltProcessor() : void

Constructor

Details
Access
private  
methodpublic_init() : void

Initialize the class

Details
Access
private  
methodpublicfree() : void

Manual free of the parser

methodpublicliteral2NumericEntities(string $stringXml) : string

Translate literal to numeric entities to avoid the 'undefined entity error' that a literal entity would cause.

Parameters
NameTypeDescription
$stringXmlstring

XML String with literal entities

Returns
TypeDescription
stringXML string with numeric entites
Details
Access
private  
methodpublicprintErrors() : void

Prints the Error message and number if an error occured

Details
Access
public  
methodpublicprocess() : string

Transform the XML data using the XSL and return the results of the transformation

Returns
TypeDescription
stringTransformed data
Details
Access
public  
methodpublicreadFromFile(string $file) : string

Return the contents of a file if the passed parameter is a file.

Parameters
NameTypeDescription
$filestring

File location

Returns
TypeDescription
stringFile contents
Details
Access
private  
methodpublicsetParam(string $name, string $value) : void

Pass top level parameters to the XSLT processor.

The parameters can be accessed in XSL with

Parameters
NameTypeDescription
$namestring

Name

$valuestring

Value

methodpublicsetSchemeHandlers( $aHandlers) : void

Parameters
NameTypeDescription
$aHandlers
methodpublicsetXml(string $xml) : void

Set the XML to be Transformed

Parameters
NameTypeDescription
$xmlstring

The XML String

Details
Access
public  
methodpublicsetXmlFile(string $file) : void

Set the XML-File to be Transformed

Parameters
NameTypeDescription
$filestring

Location of the XML file

Details
Access
public  
methodpublicsetXsl(string $xsl) : void

Set the XSLT for the Transformation

Parameters
NameTypeDescription
$xslstring

The XML String

Details
Access
public  
methodpublicsetXslFile(string $file) : void

Set the XSL-File for the Transformation

Parameters
NameTypeDescription
$filestring

Location of the XSL file

Details
Access
public  
Documentation was generated by phpDocumentor 2.0.0a12.