API Documentation

Zend/Dom/Query.php

Show: inherited
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-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Dom  
Version
$Id: Query.php 25032 2012-08-17 19:45:06Z matthew $  

\Zend_Dom_Query

Package: Zend\Dom\Query

Query DOM structures based on CSS selectors and/or XPath

Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Constants

Constant  DOC_XML = 'docXml'
Constant  DOC_HTML = 'docHtml'
Constant  DOC_XHTML = 'docXhtml'

Properties

Propertyprotectedstring  $_docType= ''

Document type

Details
Type
string
Propertyprotectedstring  $_document= ''

Details
Type
string
Propertyprotectedfalse|array  $_documentErrors= 'false'

DOMDocument errors, if any

Default valuefalseDetails
Type
falsearray
Propertyprotectednull|string  $_encoding= ''

Document encoding

Details
Type
nullstring
Propertyprotectedarray  $_xpathNamespaces= 'array()'

XPath namespaces

Default valuearray()Details
Type
array

Methods

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

Constructor

Parameters
Name Type Description
$document null|string
$encoding
methodprotected_getNodeList( \DOMDocument $document, string|array $xpathQuery ) : array

Prepare node list

Parameters
Name Type Description
$document \DOMDocument
$xpathQuery string|array
Returns
Type Description
array
methodpublicgetDocument( ) : string

Retrieve current document

Returns
Type Description
string
methodpublicgetDocumentErrors( ) : false|array

Get any DOMDocument errors found

Returns
Type Description
false|array
methodpublicgetDocumentType( ) : string

Get document type

Returns
Type Description
string
methodpublicgetEncoding( ) : null|string

Get document encoding

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

Perform a CSS selector query

Parameters
Name Type Description
$query string
Returns
Type Description
\Zend_Dom_Query_Result
methodpublicqueryXpath( string|array $xpathQuery, string $query = null ) : \Zend_Dom_Query_Result

Perform an XPath query

Parameters
Name Type Description
$xpathQuery string|array
$query string

CSS selector query

Returns
Type Description
\Zend_Dom_Query_Result
methodpublicregisterXpathNamespaces( array $xpathNamespaces ) : void

Register XPath namespaces

Parameters
Name Type Description
$xpathNamespaces array
methodpublicsetDocument( string $document, null|string $encoding = null ) : \Zend_Dom_Query

Set document to query

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

Document encoding

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

Register HTML document

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

Document encoding

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

Register XHTML document

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

Document encoding

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

Register XML document

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

Document encoding

Returns
Type Description
\Zend_Dom_Query
methodpublicsetEncoding( string $encoding ) : \Zend_Dom_Query

Set document encoding

Parameters
Name Type Description
$encoding string
Returns
Type Description
\Zend_Dom_Query
Documentation was generated by DocBlox 0.15.1.