elements * * Any select expression that is not a set of named attributes is considered unsafe * * @param DOMElement $template node * @param Tag $tag Tag this template belongs to * @return void */ public function check(DOMElement $template, Tag $tag) { $nodes = $template->getElementsByTagNameNS(self::XMLNS_XSL, 'copy-of'); foreach ($nodes as $node) { $expr = $node->getAttribute('select'); if (!preg_match('#^@[-\\w]*(?:\\s*\\|\\s*@[-\\w]*)*$#D', $expr)) { throw new UnsafeTemplateException("Cannot assess the safety of '" . $node->nodeName . "' select expression '" . $expr . "'", $node); } } } }