query = $query; } public function check(DOMElement $template, Tag $tag) { $xpath = new DOMXPath($template->ownerDocument); foreach ($xpath->query($this->query) as $node) throw new UnsafeTemplateException("Node '" . $node->nodeName . "' is disallowed because it matches '" . $this->query . "'", $node); } }