extending Xpath
[email protected] ("Andrew Mason")
| Newsgroups | php.general |
|---|---|
| Message-ID | <[email protected]> |
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