27
The only way I know in PHP to perform an XPath query on the DOM is DOMXPath, which only works on a DOMDocument:
public __construct ( DOMDocument $doc )
Is there a similar mechanism to search relatively to a DOMElement?
The problem being, I need to search an abritrary XPath (that I have no control over) relatively to a DOMElement.
I've tried to do:
$domElement->getNodePath() . '/' . $xPath;
But if the XPath contains a | (or character), this approach doesn't work.