Normalizer
class Normalizer extends IRProcessor
Constants
XMLNS_XSL |
XSL namespace |
Properties
protected DOMXPath | $xpath | from IRProcessor | |
protected Optimizer | $optimizer | ||
string | $voidRegexp |
Methods
Create and append an element to given node in the IR
Add an empty default
Add an id attribute to
Mark switch elements that are used as branch tables
Mark conditional
Mark boolean attributes
Mark void elements
Fill in output context
Details
in
IRProcessor at line 35
protected DOMElement
appendElement(DOMElement $parentNode, string $name, string $value = '')
Create and append an element to given node in the IR
in
IRProcessor at line 46
protected void
createXPath(DOMDocument $dom)
Create and store an instance of DOMXPath for given document
in
IRProcessor at line 58
protected mixed
evaluate(string $expr, DOMNode $node = null)
Evaluate an XPath expression and return its result
in
IRProcessor at line 70
protected DOMNodeList
query(string $query, DOMNode $node = null)
Run an XPath query and return its result
at line 32
void
__construct(Optimizer $optimizer)
No description
at line 43
void
normalize(DOMDocument $ir)
Normalize an IR
at line 63
protected void
addCloseTagElements(DOMDocument $ir)
Add
at line 95
protected void
addDefaultCase()
Add an empty default
at line 108
protected void
addElementIds()
Add an id attribute to
at line 123
protected string
getOutputContext(DOMNode $output)
Get the context type for given output element
at line 147
protected string|null
getParentElementId(DOMNode $node)
Get the ID of the closest "element" ancestor
at line 170
protected void
markBranchTables()
Mark switch elements that are used as branch tables
If a switch is used for a series of equality tests against the same attribute or variable, the attribute/variable is stored within the switch as "branch-key" and the values it is compared against are stored JSON-encoded in the case as "branch-values". It can be used to create optimized branch tables
at line 185
protected void
markSwitchTable(DOMElement $switch)
Mark given switch element if it's used as a branch table
at line 217
protected void
markConditionalCloseTagElements()
Mark conditional
at line 248
protected void
markBooleanAttributes()
Mark boolean attributes
The test is case-sensitive and only covers attribute that are minimized by libxslt
at line 265
protected void
markVoidElements()
Mark void elements
at line 289
protected void
setOutputContext()
Fill in output context