Zend\Dom\Query
Query DOM structures based on CSS selectors and/or XPath
Synopsis
class Query
{
- // constants
- const DOC_XML = 'docXml';
- const DOC_HTML = 'docHtml';
- const DOC_XHTML = 'docXhtml';
- // members
- protected string $document;
- protected false|array $documentErrors;
- protected string $docType;
- protected null|string $encoding;
- protected array $xpathNamespaces;
- protected mixed $xpathPhpFunctions;
- // methods
- public void __construct()
- public Query setEncoding()
- public null|string getEncoding()
- public Query setDocument()
- public Query setDocumentHtml()
- public Query setDocumentXhtml()
- public Query setDocumentXml()
- public string getDocument()
- public string getDocumentType()
- public false|array getDocumentErrors()
- public NodeList execute()
- public NodeList queryXpath()
- public void registerXpathNamespaces()
- public void registerXpathPhpFunctions()
- protected array getNodeList()
Constants
Name | Value |
---|---|
DOC_XML | 'docXml' |
DOC_HTML | 'docHtml' |
DOC_XHTML | 'docXhtml' |
Members
protected
- $docType
—
string
Document type - $document — string
- $documentErrors
—
Zend\Dom\false|array
DOMDocument errors, if any - $encoding
—
Zend\Dom\null|string
Document encoding - $xpathNamespaces
—
array
XPath namespaces - $xpathPhpFunctions
—
mixed
XPath PHP Functions
Methods
protected
- getNodeList() — Prepare node list
public
- __construct() — Constructor
- execute() — Perform a CSS selector query
- getDocument() — Retrieve current document
- getDocumentErrors() — Get any DOMDocument errors found
- getDocumentType() — Get document type
- getEncoding() — Get document encoding
- queryXpath() — Perform an XPath query
- registerXpathNamespaces() — Register XPath namespaces
- registerXpathPhpFunctions() — Register PHP Functions to use in internal DOMXPath
- setDocument() — Set document to query
- setDocumentHtml() — Register HTML document
- setDocumentXhtml() — Register XHTML document
- setDocumentXml() — Register XML document
- setEncoding() — Set document encoding