query() or queryXpath() methods; each
method will return a |
Lorem ipsum
|
Countable
and Iterator, and store the results internally as
DOMNodes/DOMElements. As an example, consider the following call,
that selects against the HTML above:
queryXpath() method; you can pass any
valid XPath query to this method, and it will return a
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; 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
the DOC_XML, DOC_XHTML, or
DOC_HTML class constants.
query($query): query the document using CSS
selector notation.
queryXpath($xPathQuery): query the document
using XPath notation.
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,
getDocument(): retrieve the DOMDocument the
selection was made against.