getElement() public method

public getElement ( )
 /**
  * undocumented function
  *
  * @param XPathExpr $xpath
  * @param XPathExpr $expr
  *
  * @return XPathExpr
  */
 protected function _xpath_nth_of_type($xpath, $expr)
 {
     if ($xpath->getElement() == '*') {
         throw new ParseException('*:nth-of-type() is not implemented');
     }
     return $this->_xpath_nth_child($xpath, $expr, false, false);
 }
示例#2
0
 /**
  * Sets the XPath expression to be only of type.
  *
  * @param XPathExpr $xpath The XPath expression
  *
  * @return XPathExpr The modified expression
  *
  * @throws ParseException Because *:only-of-type is not implemented
  */
 protected function xpath_only_of_type($xpath)
 {
     if ($xpath->getElement() == '*') {
         throw new ParseException('*:only-of-type is not implemented');
     }
     $xpath->addCondition('last() = 1');
     return $xpath;
 }