class FoldConstantXPathExpressions extends AbstractConstantFolding

Constants

XMLNS_XSL

XSL namespace

Properties

protected Document $ownerDocument from  AbstractNormalization
protected array $queries {@inheritdoc} from  AbstractConstantFolding
protected string[] $supportedFunctions

Methods

void
normalize(Element $template)

Apply this normalization rule to given template

Text
createPolymorphicText(string $textContent)

Create an xsl:text element or a text node in current template

array
getNodes()

Query and return a list of nodes of interest

bool
isXsl(DOMNode $node, string $localName = null)

Test whether given node is an XSL element

string
lowercase(string $str)

Make an ASCII string lowercase

void
normalizeAttribute(Attr $attribute)

Replace constant expressions in given attribute's AVT

void
normalizeCdataSection(CdataSection $comment)

No description

void
normalizeComment(Comment $comment)

No description

void
normalizeElement(Element $element)

Replace constant expressions in given XSL element

void
normalizeNode(DOMNode $node)

No description

void
normalizeText(Text $node)

No description

void
reset()

Reset this instance's properties after usage

array
getOptimizationPasses()

Return the optimization passes supported by the concrete implementation

string
evaluateExpression(string $expr)

Evaluate given expression and return the result

mixed
evaluate(string $expr)

Evaluate given expression without raising any warnings

string
foldConstantXPathExpression(array $m)

Evaluate and replace a constant XPath expression

bool
isConstantExpression(string $expr)

Test whether given expression seems to be constant

string
selectReplacement(string $expr, string $foldedExpr)

Select the best replacement for given expression

Details

void normalize(Element $template)

Apply this normalization rule to given template

Parameters

Element $template

node

Return Value

void

protected Text createPolymorphicText(string $textContent)

Create an xsl:text element or a text node in current template

Parameters

string $textContent

Return Value

Text

protected array getNodes()

Query and return a list of nodes of interest

Return Value

array

protected bool isXsl(DOMNode $node, string $localName = null)

Test whether given node is an XSL element

Parameters

DOMNode $node
string $localName

Return Value

bool

protected string lowercase(string $str)

Make an ASCII string lowercase

Parameters

string $str

Original string

Return Value

string

Lowercased string

protected void normalizeAttribute(Attr $attribute)

Replace constant expressions in given attribute's AVT

Parameters

Attr $attribute

Return Value

void

protected void normalizeCdataSection(CdataSection $comment)

No description

Parameters

CdataSection $comment

Return Value

void

protected void normalizeComment(Comment $comment)

No description

Parameters

Comment $comment

Return Value

void

protected void normalizeElement(Element $element)

Replace constant expressions in given XSL element

Parameters

Element $element

Return Value

void

protected void normalizeNode(DOMNode $node)

No description

Parameters

DOMNode $node

Return Value

void

protected void normalizeText(Text $node)

No description

Parameters

Text $node

Return Value

void

protected void reset()

Reset this instance's properties after usage

Return Value

void

at line 40
protected array getOptimizationPasses()

Return the optimization passes supported by the concrete implementation

Return Value

array

Regexps as keys, method names as values

protected string evaluateExpression(string $expr)

Evaluate given expression and return the result

Parameters

string $expr

Return Value

string

at line 53
protected mixed evaluate(string $expr)

Evaluate given expression without raising any warnings

Parameters

string $expr

Return Value

mixed

at line 68
protected string foldConstantXPathExpression(array $m)

Evaluate and replace a constant XPath expression

Parameters

array $m

Return Value

string

at line 94
protected bool isConstantExpression(string $expr)

Test whether given expression seems to be constant

Parameters

string $expr

Return Value

bool

at line 117
protected string selectReplacement(string $expr, string $foldedExpr)

Select the best replacement for given expression

Parameters

string $expr

Original expression

string $foldedExpr

Folded expression

Return Value

string