예제 #1
0
 /**
  * Forward to DOMXPath->registerPHPFunctions()
  *
  * @param mixed $restrict Array of function names or string with functionname to restrict callabilty to
  *
  * @throws fDOMException
  *
  * @return void
  */
 public function registerPHPFunctions($restrict = NULL)
 {
     if (is_null($this->xp)) {
         $this->getDOMXPath();
     }
     $this->xp->registerPHPFunctions($restrict);
     if (libxml_get_last_error()) {
         throw new fDOMException("Registering php functions failed.", fDOMException::RegistrationFailed);
     }
 }
예제 #2
0
 public function testQueryOneReturnsValueOnNonNodeQuery()
 {
     $this->assertEquals('1', $this->xp->queryOne('count(//root)'));
 }