class XSLT extends Renderer

Properties

protected array $params from  Renderer
protected string $savedLocale from  Renderer
protected XSLTProcessor $proc
protected bool $reloadParams
protected string $stylesheet

Methods

loadXML(string $xml)

Create a return a new DOMDocument loaded with given XML

from  Renderer
string
render(string $xml)

Render an intermediate representation

from  Renderer
string
renderPlainText(string $xml)

Render an intermediate representation of plain text

from  Renderer
string
renderRichText(string $xml)

Render an intermediate representation of rich text

string
getParameter(string $paramName)

Get the value of a parameter

from  Renderer
array
getParameters()

Get the values of all parameters

from  Renderer
void
setParameter(string $paramName, mixed $paramValue)

Set the value of a parameter from the stylesheet

void
setParameters(array $params)

Set the values of several parameters from the stylesheet

from  Renderer
void
checkUnsupported(string $xml)

Test for the presence of unsupported XML and throw an exception if found

from  Renderer
string
decodeSMP(string $str)

Decode encoded characters from the Supplementary Multilingual Plane

from  Renderer
static string
decodeEntity(array $m)

Decode a matched SGML entity

from  Renderer
void
restoreLocale()

Restore the original locale

from  Renderer
void
setLocale()

Temporarily set the locale to C

from  Renderer
__construct(string $stylesheet)

Constructor

string[]
__sleep()

Serializer

void
__wakeup()

Unserialize helper

void
load()

Create an XSLTProcessor and load the stylesheet

string
normalizeAttribute(array $m)

Normalize given attribute's value to use double quotes

string
normalizeAttributes(string $html)

Normalize all attributes in given HTML to use double quotes

string
normalizeElement(array $m)

Normalize attributes in given element to use double quotes

Details

in Renderer at line 31
protected DOMDocument loadXML(string $xml)

Create a return a new DOMDocument loaded with given XML

Parameters

string $xml

Source XML

Return Value

DOMDocument

in Renderer at line 58
string render(string $xml)

Render an intermediate representation

Parameters

string $xml

Intermediate representation

Return Value

string

Rendered result

in Renderer at line 76
protected string renderPlainText(string $xml)

Render an intermediate representation of plain text

Parameters

string $xml

Intermediate representation

Return Value

string

Rendered result

at line 110
protected string renderRichText(string $xml)

Render an intermediate representation of rich text

Parameters

string $xml

Intermediate representation

Return Value

string

Rendered result

in Renderer at line 104
string getParameter(string $paramName)

Get the value of a parameter

Parameters

string $paramName

Return Value

string

in Renderer at line 114
array getParameters()

Get the values of all parameters

Return Value

array

Associative array of parameter names and values

at line 84
void setParameter(string $paramName, mixed $paramValue)

Set the value of a parameter from the stylesheet

Parameters

string $paramName

Parameter name

mixed $paramValue

Parameter's value

Return Value

void

in Renderer at line 137
void setParameters(array $params)

Set the values of several parameters from the stylesheet

Parameters

array $params

Associative array of [parameter name => parameter value]

Return Value

void

in Renderer at line 151
protected void checkUnsupported(string $xml)

Test for the presence of unsupported XML and throw an exception if found

Parameters

string $xml XML

Return Value

void

in Renderer at line 170
protected string decodeSMP(string $str)

Decode encoded characters from the Supplementary Multilingual Plane

Parameters

string $str

Encoded string

Return Value

string

Decoded string

in Renderer at line 186
static protected string decodeEntity(array $m)

Decode a matched SGML entity

Parameters

array $m

Captures from PCRE

Return Value

string

Decoded entity

in Renderer at line 194
protected void restoreLocale()

Restore the original locale

Return Value

void

in Renderer at line 205
protected void setLocale()

Temporarily set the locale to C

Return Value

void

at line 35
__construct(string $stylesheet)

Constructor

Parameters

string $stylesheet

The stylesheet used to render intermediate representations

at line 52
string[] __sleep()

Serializer

Return Value

string[]

List of properties to serialize

at line 72
void __wakeup()

Unserialize helper

Will reload parameters if they were changed between generation and serialization

Return Value

void

at line 148
protected void load()

Create an XSLTProcessor and load the stylesheet

Return Value

void

at line 165
protected string normalizeAttribute(array $m)

Normalize given attribute's value to use double quotes

Parameters

array $m

Return Value

string

at line 181
protected string normalizeAttributes(string $html)

Normalize all attributes in given HTML to use double quotes

Parameters

string $html

Return Value

string

at line 192
protected string normalizeElement(array $m)

Normalize attributes in given element to use double quotes

Parameters

array $m

Return Value

string