Ejemplo n.º 1
0
 public function Query($node, $xml = false)
 {
     if ($xml) {
         $source = new XMLDom();
         $dom_sxe = $source->importNode($xml, true);
         $source->appendChild($dom_sxe);
     } else {
         $source = $this;
     }
     $xpath = new DOMXPath($source);
     if (is_array($this->namespace)) {
         $xpath->registerNamespace($this->namespace['name'], $this->namespace['value']);
     }
     $return = $xpath->query($node);
     if (!$return) {
         return false;
     } elseif ($return->length == 0) {
         return false;
     } else {
         return $return;
     }
 }
Ejemplo n.º 2
0
 public function toDOM()
 {
     $xml = new XMLDom();
     $xml->appendChild($xml->importNode($this, true));
     return $xml;
 }