Ejemplo n.º 1
0
Archivo: XPath.php Proyecto: volux/dom
 /**
  * @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);
 }
Ejemplo n.º 2
0
Archivo: Table.php Proyecto: volux/dom
 /**
  * @param string $version
  * @param string $encoding
  */
 public function __construct($version = self::VERSION, $encoding = self::ENCODING)
 {
     parent::__construct($version, $encoding);
     $this->root('table');
     $this->head = $this->root()->append('thead')->text(false);
     $this->body = $this->root()->append('tbody')->text(false);
 }
Ejemplo n.º 3
0
 /**
  * @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;
 }
Ejemplo n.º 4
0
Archivo: Html.php Proyecto: volux/dom
 /**
  * @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);
 }
Ejemplo n.º 5
0
Archivo: File.php Proyecto: volux/dom
 /**
  * @param string $version
  * @param string $encoding
  */
 public function __construct($version = self::VERSION, $encoding = self::ENCODING)
 {
     $data = '';
     if (is_file($version)) {
         $this->path = $version;
     } else {
         if ($version !== self::VERSION) {
             $data = $version;
             $version = self::VERSION;
         }
     }
     parent::__construct($version, $encoding);
     $this->source = $this->root('file')->attr('path', $this->path)->append($this->createCData($data));
 }
Ejemplo n.º 6
0
Archivo: Xslt.php Proyecto: volux/dom
 /**
  * @param string   $source
  * @param int|null $options
  * @param bool     $result
  *
  * @return $this|Document|Xslt
  */
 public function loadXML($source, $options = LIBXML_NOCDATA, &$result = false)
 {
     parent::loadXML($source, $options, $result);
     $this->processor();
     return $this;
 }
Ejemplo n.º 7
0
Archivo: Form.php Proyecto: volux/dom
 /**
  * @param string $version
  * @param string $encoding
  */
 public function __construct($version = self::VERSION, $encoding = self::ENCODING)
 {
     parent::__construct($version, $encoding);
     $this->root('form')->text('');
     $this->to(true);
 }
Ejemplo n.º 8
0
Archivo: Cdata.php Proyecto: volux/dom
 /**
  * @param $element
  *
  * @return Element|Field|Tag
  */
 public function before($element)
 {
     return $this->parent()->insertBefore($this->ownerDocument->importNode($this->ownerDocument->check($element)), $this);
 }
Ejemplo n.º 9
0
 /**
  * @return string
  */
 public function __toString()
 {
     return $this->ownerDocument->saveXML($this);
 }
Ejemplo n.º 10
0
Archivo: Set.php Proyecto: volux/dom
 /**
  * @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);
 }