class InlineInferredValues extends AbstractNormalization

Inline the text content of a node or the value of an attribute where it's known

Will replace

with Foo This should be applied after control structures have been optimized

Constants

XMLNS_XSL

XSL namespace

Properties

protected Document $ownerDocument from  AbstractNormalization
protected array $queries {@inheritdoc}

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)

No description

void
normalizeCdataSection(CdataSection $comment)

No description

void
normalizeComment(Comment $comment)

No description

void
normalizeElement(Element $element)

No description

void
normalizeNode(DOMNode $node)

No description

void
normalizeText(Text $node)

No description

void
reset()

Reset this instance's properties after usage

void
inlineInferredValue(Element $node, string $expr, string $value)

Replace the inferred value in given node and its descendants

replaceAttribute(Attr $attribute, string $expr, string $value)

Replace an expression with a literal value in given attribute

void
replaceValueOf(Element $valueOf, string $value)

Replace an xsl:value-of element with a literal value

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)

No description

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

at line 35
protected void normalizeElement(Element $element)

No description

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 57
protected void inlineInferredValue(Element $node, string $expr, string $value)

Replace the inferred value in given node and its descendants

Parameters

Element $node

Context node

string $expr

XPath expression

string $value

Inferred value

Return Value

void

at line 77
protected replaceAttribute(Attr $attribute, string $expr, string $value)

Replace an expression with a literal value in given attribute

Parameters

Attr $attribute
string $expr
string $value

at line 102
protected void replaceValueOf(Element $valueOf, string $value)

Replace an xsl:value-of element with a literal value

Parameters

Element $valueOf
string $value

Return Value

void