Class Query

Summary

Fully Qualified Name: Laminas\Dom\Query

Description

Query DOM structures based on CSS selectors and/or XPath

Methods

Name Description Defined By
__construct() Constructor Query
execute() Perform a CSS selector query Query
getDocument() Retrieve current document Query
getDocumentErrors() Get any DOMDocument errors found Query
getDocumentType() Get document type Query
getEncoding() Get document encoding Query
queryXpath() Perform an XPath query Query
registerXpathNamespaces() Register XPath namespaces Query
registerXpathPhpFunctions() Register PHP Functions to use in internal DOMXPath Query
setDocument() Set document to query Query
setDocumentHtml() Register HTML document Query
setDocumentXhtml() Register XHTML document Query
setDocumentXml() Register XML document Query
setEncoding() Set document encoding Query

Method Details

__construct()

Constructor

Parameter Name Type Description
$document null|string
$encoding null|string

Returns:

execute()

Perform a CSS selector query

Parameter Name Type Description
$query string
$contextNode \DOMNode

Returns: \NodeList

getDocument()

Retrieve current document

Returns: string

getDocumentErrors()

Get any DOMDocument errors found

Returns: bool|array

getDocumentType()

Get document type

Returns: string

getEncoding()

Get document encoding

Returns: null|string

queryXpath()

Perform an XPath query

Parameter Name Type Description
$xpathQuery string|array
$query string|null CSS
$contextNode \DOMNode $contextNode

Returns: \NodeList

registerXpathNamespaces()

Register XPath namespaces

Parameter Name Type Description
$xpathNamespaces array

Returns: void

registerXpathPhpFunctions()

Register PHP Functions to use in internal DOMXPath

Parameter Name Type Description
$xpathPhpFunctions bool

Returns: void

setDocument()

Set document to query

Parameter Name Type Description
$document string
$encoding null|string Document

Returns: \Query

setDocumentHtml()

Register HTML document

Parameter Name Type Description
$document string
$encoding null|string Document

Returns: \Query

setDocumentXhtml()

Register XHTML document

Parameter Name Type Description
$document string
$encoding null|string Document

Returns: \Query

setDocumentXml()

Register XML document

Parameter Name Type Description
$document string
$encoding null|string Document

Returns: \Query

setEncoding()

Set document encoding

Parameter Name Type Description
$encoding string

Returns: \Query

Top