Dom/Query.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled
with this package in the file LICENSE.txt.
It is also available through the world-wide-web at this URL:
http://framework.zend.com/license/new-bsd
If you did not receive a copy of the license and are unable to
obtain it through the world-wide-web, please send an email
to license@zend.com so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Dom
- Version
- $Id$
\Zend_Dom_Query
Package: Zend_Dom\Query
Query DOM structures based on CSS selectors and/or XPath
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Constants
Properties
false|array $_documentErrors = false
DOMDocument errors, if any
Default value
false
Details- Type
- false | array
Methods
__construct(null | string $document = null, $encoding = null) : void
Constructor
Parameters
Name | Type | Description |
---|---|---|
$document | null | string | |
$encoding |
_getNodeList(\DOMDocument $document, string | array $xpathQuery) : array
Prepare node list
Parameters
Returns
Name | Type | Description |
---|---|---|
$document | \DOMDocument | |
$xpathQuery | string | array |
Type | Description |
---|---|
array |
getDocumentErrors() : false | array
Get any DOMDocument errors found
Returns
Type | Description |
---|---|
false | array |
query(string $query) : \Zend_Dom_Query_Result
Perform a CSS selector query
Parameters
Returns
Name | Type | Description |
---|---|---|
$query | string |
Type | Description |
---|---|
\Zend_Dom_Query_Result |
queryXpath(string | array $xpathQuery, string $query = null) : \Zend_Dom_Query_Result
Perform an XPath query
Parameters
Returns
Name | Type | Description |
---|---|---|
$xpathQuery | string | array | |
$query | string | CSS selector query |
Type | Description |
---|---|
\Zend_Dom_Query_Result |
registerXpathNamespaces(array $xpathNamespaces) : void
Register XPath namespaces
Parameters
Name | Type | Description |
---|---|---|
$xpathNamespaces | array |
setDocument(string $document, null | string $encoding = null) : \Zend_Dom_Query
Set document to query
Parameters
Returns
Name | Type | Description |
---|---|---|
$document | string | |
$encoding | null | string | Document encoding |
Type | Description |
---|---|
\Zend_Dom_Query |
setDocumentHtml(string $document, null | string $encoding = null) : \Zend_Dom_Query
Register HTML document
Parameters
Returns
Name | Type | Description |
---|---|---|
$document | string | |
$encoding | null | string | Document encoding |
Type | Description |
---|---|
\Zend_Dom_Query |
setDocumentXhtml(string $document, null | string $encoding = null) : \Zend_Dom_Query
Register XHTML document
Parameters
Returns
Name | Type | Description |
---|---|---|
$document | string | |
$encoding | null | string | Document encoding |
Type | Description |
---|---|
\Zend_Dom_Query |
setDocumentXml(string $document, null | string $encoding = null) : \Zend_Dom_Query
Register XML document
Parameters
Returns
Name | Type | Description |
---|---|---|
$document | string | |
$encoding | null | string | Document encoding |
Type | Description |
---|---|
\Zend_Dom_Query |
setEncoding(string $encoding) : \Zend_Dom_Query
Set document encoding
Parameters
Returns
Name | Type | Description |
---|---|---|
$encoding | string |
Type | Description |
---|---|
\Zend_Dom_Query |