Skip to content

Commit

Permalink
WiP
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshyPHP committed Mar 21, 2020
1 parent ae97364 commit 5240169
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Configurator/TemplateChecks/AbstractXSLSupportCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ public function check(DOMElement $template, Tag $tag): void
$this->checkXPathExpressions($template);
}

/**
* Check given XPath expression
*/
protected function checkXPathExpression(string $expr): void
{
preg_match_all('("[^"]*+"|\'[^\']*+\'|(*:fn)[-\\w]++(?=\\s*\\())', $expr, $m);
Expand All @@ -54,6 +57,9 @@ protected function checkXPathExpression(string $expr): void
}
}

/**
* Check all XPath expressions in given template
*/
protected function checkXPathExpressions(DOMElement $template): void
{
foreach ($this->getXPathExpressions($template) as $expr)
Expand All @@ -62,6 +68,9 @@ protected function checkXPathExpressions(DOMElement $template): void
}
}

/**
* Check all XSL elements in given template
*/
protected function checkXslElements(DOMElement $template): void
{
$xpath = new DOMXPath($template->ownerDocument);
Expand All @@ -81,6 +90,9 @@ protected function checkXslElements(DOMElement $template): void
}
}

/**
* Return all XPath expressions in given template
*/
protected function getXPathExpressions(DOMElement $template): array
{
$exprs = [];
Expand Down

0 comments on commit 5240169

Please sign in to comment.