PHP Класс FluentDOM\Xpath

Наследование: extends DOMXPath
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( DOMDocument $dom ) HHVM and some old PHP versions do not have a $document property by default Add it is added if it was not found after executing parent constructor.
__get ( string $name ) : mixed
__invoke ( string $expression, DOMNode $contextNode = NULL ) : string | float | boolean | DOMNodeList Fetch nodes or scalar values from the DOM using Xpath expression.
__isset ( string $name ) : boolean
__set ( string $name, mixed $value ) : mixed
__unset ( string $name )
evaluate ( string $expression, DOMNode $contextNode = NULL, null | boolean $registerNodeNS = NULL ) : string | float | boolean | DOMNodeList Fetch nodes or scalar values from the DOM using Xpath expression.
firstOf ( string $expression, DOMNode $contextNode = NULL, null | boolean $registerNodeNS = NULL ) : DOMNode | null Returns the first node matched by the expression or NULL.
query ( string $expression, DOMNode $contextNode = NULL, null | boolean $registerNodeNS = NULL ) : DOMNodeList Fetch nodes defined by the xpath expression and return the node list.
quote ( string $string ) : string Quote (and escape) a value to use it in an xpath expression.
registerNamespace ( string $prefix, string $namespace ) : boolean If the owner document is a FluentDOM\Document register the namespace on the document object, too.

Описание методов

__construct() публичный Метод

HHVM and some old PHP versions do not have a $document property by default Add it is added if it was not found after executing parent constructor.
public __construct ( DOMDocument $dom )
$dom DOMDocument

__get() публичный Метод

public __get ( string $name ) : mixed
$name string
Результат mixed

__invoke() публичный Метод

Fetch nodes or scalar values from the DOM using Xpath expression.
public __invoke ( string $expression, DOMNode $contextNode = NULL ) : string | float | boolean | DOMNodeList
$expression string
$contextNode DOMNode
Результат string | float | boolean | DOMNodeList

__isset() публичный Метод

public __isset ( string $name ) : boolean
$name string
Результат boolean

__set() публичный Метод

public __set ( string $name, mixed $value ) : mixed
$name string
$value mixed
Результат mixed

__unset() публичный Метод

public __unset ( string $name )
$name string

evaluate() публичный Метод

The main difference to DOMXpath::evaluate() is the handling of the third argument. Namespace registration can be changed using the property and is disabled by default.
public evaluate ( string $expression, DOMNode $contextNode = NULL, null | boolean $registerNodeNS = NULL ) : string | float | boolean | DOMNodeList
$expression string
$contextNode DOMNode
$registerNodeNS null | boolean
Результат string | float | boolean | DOMNodeList

firstOf() публичный Метод

Returns the first node matched by the expression or NULL.
public firstOf ( string $expression, DOMNode $contextNode = NULL, null | boolean $registerNodeNS = NULL ) : DOMNode | null
$expression string
$contextNode DOMNode
$registerNodeNS null | boolean
Результат DOMNode | null

query() публичный Метод

This method is deprecated and only implemented for BC. So this method calls evaluate().
Устаревший:
public query ( string $expression, DOMNode $contextNode = NULL, null | boolean $registerNodeNS = NULL ) : DOMNodeList
$expression string
$contextNode DOMNode
$registerNodeNS null | boolean
Результат DOMNodeList

quote() публичный Метод

Xpath 1 does not have a way to escape quotes, it only allows double quotes in single quoted literals and single quotes in double quoted literals. If both quotes are included in the string, the method will generate a concat() function call.
public quote ( string $string ) : string
$string string
Результат string

registerNamespace() публичный Метод

If the owner document is a FluentDOM\Document register the namespace on the document object, too.
public registerNamespace ( string $prefix, string $namespace ) : boolean
$prefix string
$namespace string
Результат boolean