Re: extending Xpath

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Andrew Mason wrote:
Hi,
I was wondering if it was possible to extend the DOMXpath object in a
similar fashion to the DomDocument.

I was hoping to write a wrapper to provide an interface similar to
prepared statements in the db libraries for the xpath processor.


$xpath = new myxpath();

$stmt = $xpath->prepare("/foo/bar[@foo = '?' ]");
$stmt->bindParam( '?', $potentiallynastystring );
$x = $stmt->execute();

I have tried :

final class timber_utils_domxpath extends DomXpath
{
   public function __construct( DOMDocument $dom )
   {
       echo "in here";
       parent::_construct( $dom );
   }
}


but I get the following error
Fatal error: Call to undefined method DOMXPath::_construct()

Your missing an underscore.  It needs two not one.


Many thanks
Andrew



--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
       and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
    by William Shakespeare


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux