BlueSpice MediaWiki master
 All Classes Namespaces Files Functions Variables Groups Pages
DOMXPath Class Reference

Public Member Functions

 __construct (DOMDocument $doc)
 
 registerNamespace ($prefix, $namespaceURI)
 
 query ($expression, $contextnode=null)
 
 evaluate ($expression, $contextnode=null)
 
 registerPhpFunctions ($restrict=null)
 

Public Attributes

 $document
 

Detailed Description

Constructor & Destructor Documentation

DOMXPath::__construct ( DOMDocument  $doc)

Creates a new <classname>DOMXPath</classname> object DOMDocument $doc The DOMDocument</classname> associated with the <classname>DOMXPath</classname>.

Since
5.0

Member Function Documentation

DOMXPath::evaluate (   $expression,
  $contextnode = null 
)

Evaluates the given XPath expression and returns a typed result if possible. string $expression The XPath expression to execute.

Parameters
DOMNode$contextnode[optional]

The optional contextnode can be specified for doing relative XPath queries. By default, the queries are relative to the root element.

Returns
mixed a typed result if possible or a DOMNodeList containing all nodes matching the given XPath expression.
Since
5.1.0
DOMXPath::query (   $expression,
  $contextnode = null 
)

Evaluates the given XPath expression string $expression The XPath expression to execute.

Parameters
DOMNode$contextnode[optional]

The optional contextnode can be specified for doing relative XPath queries. By default, the queries are relative to the root element.

Returns
DOMNodeList a DOMNodeList containing all nodes matching the given XPath expression. Any expression which do not return nodes will return an empty DOMNodeList.
Since
5.0
DOMXPath::registerNamespace (   $prefix,
  $namespaceURI 
)

Registers the namespace with the <classname>DOMXPath</classname> object string $prefix The prefix.

Parameters
string$namespaceURI

The URI of the namespace.

Returns
bool true on success or false on failure.
Since
5.0
DOMXPath::registerPhpFunctions (   $restrict = null)

Register PHP functions as XPath functions mixed $restrict [optional] Use this parameter to only allow certain functions to be called from XPath.

This parameter can be either a string (a function name) or an array of function names.

Returns
void
Since
5.3.0

The documentation for this class was generated from the following file: