/** * @param string|array $expression * @param null|\DOMNode|\DOMDocument|Document|Html|Table|Form|Attr|Element|Tag|Field|Text|Cdata|Comment $contextnode * @param bool $registerNodeNS * * @return Set */ public function query($expression, \DOMNode $contextnode = null, $registerNodeNS = true) { $prepared = $this->expression($expression); $result = @parent::query($prepared, $contextnode, $registerNodeNS); $this->doc->debug(array('result', $expression, $prepared, $result)); return $this->doc->set($result); }
/** * @param string $version * @param string $encoding */ public function __construct($version = self::VERSION, $encoding = self::ENCODING) { parent::__construct($version, $encoding); $this->root('html'); $this->head = $this->root()->append('head')->text(false); $this->body = $this->root()->append('body')->text(false); $this->container = new Document(); $this->container->root('keep'); $this->scripts = $this->container->root()->append('scripts'); $this->ajax = $this->container->root()->append(self::AJAX_ROOT); }
/** * @param $wrapper * * @return Element|Tag|Field */ public function wrap($wrapper) { $parent = $this->parentNode; $wrapper = $parent->appendChild($this->ownerDocument->check($wrapper)); $wrapper->appendChild($this->cloneNode(true)); $parent->replaceChild($wrapper, $this); return $wrapper; }
public function testDomHtml() { $this->assertEquals($this->text, $this->dom->find('.content')->text()); $this->assertEquals($this->text, $this->dom->find('#test')->text()); }
/** * @param $element * * @return Element|Field|Tag */ public function before($element) { return $this->parent()->insertBefore($this->ownerDocument->importNode($this->ownerDocument->check($element)), $this); }
/** * @return string */ public function __toString() { return $this->ownerDocument->saveXML($this); }
/** * @todo make faster!!! * @param string $xslFile * @param array $xsltParameters * * @return $this|Set */ public function xslt($xslFile, $xsltParameters = array()) { return $this->ownerDocument->xslt($xslFile, $xsltParameters, $this); }