| Conditions | 4 |
| Paths | 3 |
| Total Lines | 24 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | /** |
||
| 25 | * {@inheritdoc} |
||
| 26 | */ |
||
| 27 | protected function normalizeElement(DOMElement $element) |
||
| 28 | { |
||
| 29 | $if = $element->parentNode; |
||
| 30 | $test = $if->getAttribute('test'); |
||
| 31 | $select = $element->getAttribute('select'); |
||
| 32 | |||
| 33 | // Ensure that the expressions match, and that they select one single attribute |
||
| 34 | if ($select !== $test || !preg_match('#^@[-\\w]+$#D', $select)) |
||
| 35 | { |
||
| 36 | return; |
||
| 37 | } |
||
| 38 | |||
| 39 | // Replace the xsl:if element with the xsl:value-of element |
||
| 40 | $if->parentNode->replaceChild($if->removeChild($element), $if); |
||
| 41 | } |
||
| 42 | } |