PHP 클래스 FluentDOM\Xpath

상속: extends DOMXPath
파일 보기 프로젝트 열기: fluentdom/fluentdom 1 사용 예제들

공개 메소드들

메소드 설명
__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