1 | <?php |
||
14 | abstract class AbstractConstantFolding extends AbstractNormalization |
||
15 | { |
||
16 | /** |
||
17 | * {@inheritdoc} |
||
18 | */ |
||
19 | protected $queries = [ |
||
20 | '//*[namespace-uri() != $XSL]/@*[contains(.,"{")]', |
||
21 | '//xsl:value-of' |
||
22 | ]; |
||
23 | |||
24 | /** |
||
25 | * Return the optimization passes supported by the concrete implementation |
||
26 | * |
||
27 | * @return array Regexps as keys, method names as values |
||
28 | */ |
||
29 | abstract protected function getOptimizationPasses(); |
||
30 | |||
31 | /** |
||
32 | * Evaluate given expression and return the result |
||
33 | * |
||
34 | * @param string $expr |
||
35 | * @return string |
||
36 | */ |
||
37 | protected function evaluateExpression($expr) |
||
48 | |||
49 | /** |
||
50 | * Replace constant expressions in given AVT |
||
51 | * |
||
52 | * @param DOMAttr $attribute |
||
53 | * @return void |
||
54 | */ |
||
55 | protected function normalizeAttribute(DOMAttr $attribute) |
||
70 | |||
71 | /** |
||
72 | * Replace constant expressions in given xsl:value-of element |
||
73 | * |
||
74 | * @param DOMElement $valueOf |
||
75 | * @return void |
||
76 | */ |
||
77 | protected function normalizeElement(DOMElement $valueOf) |
||
81 | } |