document - XPath 编辑

XSLT/XPath Reference: XSLT elements, EXSLT functions, XPath functions, XPath axes


The document finds a node-set in an external document, or multiple external documents, and returns the resulting node-set.

Syntax

document(URI [,node-set] )

Arguments

URI
An absolute or relative URI of the document to be retrieved. The URI may also include a fragment identifier.
node-set (optional)
An expression pointing to a node-set in the external document that should be returned.

Returns

A node-set.

Notes

  • If the URI contains a fragment identifier and that fragment can be identified in the external document, that fragment will be treated as the root in the node-set argument's expression. If the node-set argument is omitted, the entire fragment will be returned.
  • If the URI argument is a node-set, and the second argument is present, each node in the node-set will be evaluated as a separate URI, and the returned node-set will be as if the document function has been called multiple times (each time with the same second argument just as given in the function call) and the resulting node-sets had been concatenated into a single node-set.
  • Other specific conditions exist with specified behaviors. See the XSLT 1.0 documentation for details.
  • Since the URI is relative to the XSL document, document("") would return the root node of the current document.

This function is an XSLT-specific addition to XPath. It is not a part of the core XPath function library.

Defined

XSLT 1.0 12.1

Gecko support

Supported.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:88 次

字数:2697

最后编辑:7 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文