Esempio n. 1
0
File: Cdata.php Progetto: volux/dom
 /**
  * @param string|array $expr css selector (if in array: with axis)
  * @param null|int $index
  * @param null|\DOMNode|Element|Tag|Field|Attr|Text|Cdata $context
  *
  * @return Element|Tag|Field|Attr|Text|Set
  */
 public function find($expr, $index = null, $context = null)
 {
     if (is_null($context)) {
         $context = $this;
     }
     return $this->ownerDocument->find($expr, $index, $context);
 }
Esempio n. 2
0
 /**
  * @param string|array $expr css selector or xPath
  * @param null|int $index
  * @param null|Element|Tag $context
  *
  * @return Element|Tag|Field|Attr|Text|Cdata|Comment|Set
  */
 public function find($expr, $index = null, $context = null)
 {
     if (is_null($context)) {
         $context = $this;
         if (!is_array($expr) and preg_match(Document::MATCH_ONCE_WORD, $expr)) {
             /**
              * @todo test speed
              */
             return $context->getElementsByTagName($expr, $index);
         }
     }
     return $this->ownerDocument->find($expr, $index, $context);
 }