XPathEvaluator.createNSResolver()

我們的志工尚未將本文翻譯為 正體中文 (繁體) 版本。加入我們,幫忙翻譯!
您也可以閱讀本文的 English (US) 版本。

This method adapts any DOM node to resolve namespaces so that an XPath expression can be easily evaluated relative to the context of the node where it appeared within the document.

This adapter works like the DOM Level 3 method Node.lookupNamespaceURI() in resolving the namespace URI from a given prefix using the current information available in the node's hierarchy at the time the method is called, also correctly resolving the implicit xml prefix.

Syntax

XPathNSResolver XPathEvaluator.createNSResolver(nodeResolver);

Parameters

nodeResolver
A Node to be used as a context for namespace resolution.

Return value

An XPathNSResolver object which resolves namespaces with respect to the definitions in scope for a specified node.

Specifications

Specification Status Comment
Document Object Model (DOM) Level 3 XPath Specification
The definition of 'XPathEvaluator.createNSResolver()' in that specification.
Recommendation Initial definition

Browser compatibility

No compatibility data found. Please contribute data for "api.XPathEvaluator.createNSResolver" (depth: 1) to the MDN compatibility data repository.

See also

文件標籤與貢獻者

此頁面的貢獻者: mdnwebdocs-bot, Sebastianz
最近更新: mdnwebdocs-bot,