Query DOM structures based on CSS selectors and/or XPath

package Zend_Dom

 Methods

Constructor

__construct(null | string $document, null | string $encoding) 

Parameters

$document

nullstring

$encoding

nullstring

Perform a CSS selector query

execute(string $query) : \Zend\Dom\NodeList

Parameters

$query

string

Returns

Retrieve current document

getDocument() : string

Returns

string

Get any DOMDocument errors found

getDocumentErrors() : false | array

Returns

falsearray

Get document type

getDocumentType() : string

Returns

string

Get document encoding

getEncoding() : null | string

Returns

nullstring

Perform an XPath query

queryXpath(string | array $xpathQuery, string | null $query) : \Zend\Dom\NodeList

Parameters

$xpathQuery

stringarray

$query

stringnull

CSS selector query

Exceptions

\Zend\Dom\Exception\RuntimeException

Returns

Register XPath namespaces

registerXpathNamespaces(array $xpathNamespaces) : void

Parameters

$xpathNamespaces

array

Register PHP Functions to use in internal DOMXPath

registerXpathPhpFunctions(bool $xpathPhpFunctions) : void

Parameters

$xpathPhpFunctions

bool

Set document to query

setDocument(string $document, null | string $encoding) : \Zend\Dom\Query

Parameters

$document

string

$encoding

nullstring

Document encoding

Returns

Register HTML document

setDocumentHtml(string $document, null | string $encoding) : \Zend\Dom\Query

Parameters

$document

string

$encoding

nullstring

Document encoding

Returns

Register XHTML document

setDocumentXhtml(string $document, null | string $encoding) : \Zend\Dom\Query

Parameters

$document

string

$encoding

nullstring

Document encoding

Returns

Register XML document

setDocumentXml(string $document, null | string $encoding) : \Zend\Dom\Query

Parameters

$document

string

$encoding

nullstring

Document encoding

Returns

Set document encoding

setEncoding(string $encoding) : \Zend\Dom\Query

Parameters

$encoding

string

Returns

Prepare node list

getNodeList(\DOMDocument $document, string | array $xpathQuery) : array

Parameters

$document

\DOMDocument

$xpathQuery

stringarray

Returns

array

 Properties

 

Document type

$docType : string

 

$document

$document : string

 

DOMDocument errors, if any

$documentErrors : false | array

 

Document encoding

$encoding : null | string

 

XPath namespaces

$xpathNamespaces : array

 

XPath PHP Functions

$xpathPhpFunctions : mixed

 Constants

 

DOC_HTML

DOC_HTML 

 

DOC_XHTML

DOC_XHTML 

 

DOC_XML

DOC_XML