namespaceURI = $namespaceURI; $this->elName = $elName; } /** * Test for the presence of an element of given name in given namespace * * @param DOMElement $template node * @param Tag $tag Tag this template belongs to * @return void */ public function check(DOMElement $template, Tag $tag) { $node = $template->getElementsByTagNameNS($this->namespaceURI, $this->elName)->item(0); if ($node) { throw new UnsafeTemplateException("Element '" . $node->nodeName . "' is disallowed", $node); } } }