DOM DOMXPath 클래스
(PHP 5, PHP 7, PHP 8)
소개
XPath 1.0 지원
클래스 개요
class DOMXPath {
/* Properties */
public readonly DOMDocument $document;
public bool $registerNodeNamespaces;
/* Methods */
public __construct(DOMDocument $document, bool $registerNodeNS = true)
public evaluate(string $expression, ?DOMNode $contextNode = null, bool $registerNodeNS = true): mixed
public query(string $expression, ?DOMNode $contextNode = null, bool $registerNodeNS = true): mixed
public registerNamespace(string $prefix, string $namespace): bool
public registerPhpFunctions(string|array|null $restrict = null): void
}
Properties
- document
- registerNodeNamespaces
true
로 설정하면 노드의 네임스페이스가 등록됩니다.
변경 로그
버전 | 설명 |
---|---|
8.0.0 | registerNodeNamespaces 속성이 추가되었습니다. |
목차
- DOMXPath::__construct — 새로운 DOMXPath 객체를 생성합니다.
- DOMXPath::evaluate — 주어진 XPath 표현식을 평가하고 가능한 경우 형식화된 결과를 반환합니다.
- DOMXPath::query — 주어진 XPath 표현식을 평가합니다.
- DOMXPath::registerNamespace — DOMXPath 객체에 네임스페이스를 등록합니다.
- DOMXPath::registerPhpFunctions — PHP 함수를 XPath 함수로 등록