MergeIdenticalConditionalBranches
class MergeIdenticalConditionalBranches extends AbstractNormalization
Merge xsl:when branches if they have identical content
NOTE: may fail if branches have identical equality expressions, e.g. "@a=1" and "@a=1"
Constants
XMLNS_XSL |
XSL namespace |
Properties
protected Document | $ownerDocument | from AbstractNormalization | |
protected array | $queries | {@inheritdoc} |
Methods
Apply this normalization rule to given template
Create an xsl:text element or a text node in current template
No description
Collect consecutive xsl:when elements that share the same kind of equality tests
Merge identical xsl:when elements from a list
Inspect the branches of an xsl:choose element and merge branches if their content is identical and their order does not matter
Inspect the branches of an xsl:choose element and merge consecutive branches if their content is identical
Details
in
AbstractNormalization at line 40
void
normalize(Element $template)
Apply this normalization rule to given template
in
AbstractNormalization at line 57
protected Text
createPolymorphicText(string $textContent)
Create an xsl:text element or a text node in current template
in
AbstractNormalization at line 69
protected array
getNodes()
Query and return a list of nodes of interest
in
AbstractNormalization at line 83
protected bool
isXsl(DOMNode $node, string $localName = null)
Test whether given node is an XSL element
in
AbstractNormalization at line 94
protected string
lowercase(string $str)
Make an ASCII string lowercase
in
AbstractNormalization at line 99
protected void
normalizeAttribute(Attr $attribute)
No description
in
AbstractNormalization at line 103
protected void
normalizeCdataSection(CdataSection $comment)
No description
in
AbstractNormalization at line 107
protected void
normalizeComment(Comment $comment)
No description
at line 172
protected void
normalizeElement(Element $element)
No description
in
AbstractNormalization at line 115
protected void
normalizeNode(DOMNode $node)
No description
in
AbstractNormalization at line 139
protected void
normalizeText(Text $node)
No description
in
AbstractNormalization at line 146
protected void
reset()
Reset this instance's properties after usage
at line 35
protected Element[]
collectCompatibleBranches(DOMNode $node)
Collect consecutive xsl:when elements that share the same kind of equality tests
Will return xsl:when elements that test a constant part (e.g. a literal) against the same variable part (e.g. the same attribute)
at line 81
protected void
mergeBranches(array $nodes)
Merge identical xsl:when elements from a list
at line 121
protected void
mergeCompatibleBranches(Element $choose)
Inspect the branches of an xsl:choose element and merge branches if their content is identical and their order does not matter
at line 149
protected void
mergeConsecutiveBranches(Element $choose)
Inspect the branches of an xsl:choose element and merge consecutive branches if their content is identical