extending Xpath

From: Date: Thu, 01 May 2008 12:07:01 +0000
Subject: extending Xpath
Groups: php.general 
Request: Send a blank email to php-general+get-273771@lists.php.net to get a copy of this message
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() Many thanks Andrew

« previous php.general (#273771) next »