The Zend_Dom_Query family of classes have the following
methods available.
The following methods are available to
Zend_Dom_Query:
setDocumentXml($document): specify an XML string to query against.setDocumentXhtml($document): specify an XHTML string to query against.setDocumentHtml($document): specify an HTML string to query against.setDocument($document): specify a string to query against;Zend_Dom_Querywill then attempt to autodetect the document type.getDocument(): retrieve the original document string provided to the object.getDocumentType(): retrieve the document type of the document provided to the object; will be one of theDOC_XML,DOC_XHTML, orDOC_HTMLclass constants.query($query): query the document using CSS selector notation.queryXpath($xPathQuery): query the document using XPath notation.
As mentioned previously, Zend_Dom_Query_Result
implements both Iterator and
Countable, and as such can be used in a
foreach() loop as well as with the
count() function. Additionally, it exposes the
following methods:
getCssQuery(): return the CSS selector query used to produce the result (if any).getXpathQuery(): return the XPath query used to produce the result. Internally,Zend_Dom_Queryconverts CSS selector queries to XPath, so this value will always be populated.getDocument(): retrieve the DOMDocument the selection was made against.




