Dom/Query.php

Show: PublicProtectedPrivateinherited
Table of Contents
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

>VConstant  DOC_XML = 'docXml'
>VConstant  DOC_HTML = 'docHtml'
>VConstant  DOC_XHTML = 'docXhtml'

Properties

>VPropertyprotectedstring $_docType
Document type
Details
Type
string
>VPropertyprotectedstring $_document
Details
Type
string
>VPropertyprotectedfalse|array $_documentErrors = false
DOMDocument errors, if any
Default valuefalseDetails
Type
false | array
>VPropertyprotectednull|string $_encoding
Document encoding
Details
Type
null | string
>VPropertyprotectedarray $_xpathNamespaces = array()
XPath namespaces
Default valuearray()Details
Type
array

Methods

methodpublic__construct(null | string $document = null,  $encoding = null) : void

Constructor

Parameters
NameTypeDescription
$documentnull | string
$encoding
methodprotected_getNodeList(\DOMDocument $document, string | array $xpathQuery) : array

Prepare node list

Parameters
NameTypeDescription
$document\DOMDocument
$xpathQuerystring | array
Returns
TypeDescription
array
methodpublicgetDocument() : string

Retrieve current document

Returns
TypeDescription
string
methodpublicgetDocumentErrors() : false | array

Get any DOMDocument errors found

Returns
TypeDescription
false | array
methodpublicgetDocumentType() : string

Get document type

Returns
TypeDescription
string
methodpublicgetEncoding() : null | string

Get document encoding

Returns
TypeDescription
null | string
methodpublicquery(string $query) : \Zend_Dom_Query_Result

Perform a CSS selector query

Parameters
NameTypeDescription
$querystring
Returns
TypeDescription
\Zend_Dom_Query_Result
methodpublicqueryXpath(string | array $xpathQuery, string $query = null) : \Zend_Dom_Query_Result

Perform an XPath query

Parameters
NameTypeDescription
$xpathQuerystring | array
$querystring

CSS selector query

Returns
TypeDescription
\Zend_Dom_Query_Result
methodpublicregisterXpathNamespaces(array $xpathNamespaces) : void

Register XPath namespaces

Parameters
NameTypeDescription
$xpathNamespacesarray
methodpublicsetDocument(string $document, null | string $encoding = null) : \Zend_Dom_Query

Set document to query

Parameters
NameTypeDescription
$documentstring
$encodingnull | string

Document encoding

Returns
TypeDescription
\Zend_Dom_Query
methodpublicsetDocumentHtml(string $document, null | string $encoding = null) : \Zend_Dom_Query

Register HTML document

Parameters
NameTypeDescription
$documentstring
$encodingnull | string

Document encoding

Returns
TypeDescription
\Zend_Dom_Query
methodpublicsetDocumentXhtml(string $document, null | string $encoding = null) : \Zend_Dom_Query

Register XHTML document

Parameters
NameTypeDescription
$documentstring
$encodingnull | string

Document encoding

Returns
TypeDescription
\Zend_Dom_Query
methodpublicsetDocumentXml(string $document, null | string $encoding = null) : \Zend_Dom_Query

Register XML document

Parameters
NameTypeDescription
$documentstring
$encodingnull | string

Document encoding

Returns
TypeDescription
\Zend_Dom_Query
methodpublicsetEncoding(string $encoding) : \Zend_Dom_Query

Set document encoding

Parameters
NameTypeDescription
$encodingstring
Returns
TypeDescription
\Zend_Dom_Query
Documentation was generated by phpDocumentor 2.2.0 .