ZF-3939: Set Zend_Dom_Query document from existing DOMDocument object
Description
In addition to accepting XML/HTML strings, the Zend_Dom_Query constructor (and setDocument*() methods) should accept DOMDocument objects, allowing developers to use Zend_Dom_Query to query already-existing DOM objects without first converting them to strings. E.g.,
$domObject = new DOMDocument('1.0', 'utf-8');
$domObject->loadXML('
First paragraph.
Second paragraph.
');
$queryObject = new Zend_Dom_Query($domObject);
$paragraphs = $queryObject->query('p.second');
echo $paragraphs->current()->nodeValue; // "Second paragraph."
This usage would parallel the constructor of the PHP DOMXPath class.
Comments
Posted by Rob Allen (rob) on 2012-11-20T20:53:10.000+0000
Bulk change of all issues last updated before 1st January 2010 as "Won't Fix".
Feel free to re-open and provide a patch if you want to fix this issue.