当前位置: 首页 > 网络学院 > XML相关教程 > XSL/XSLT > XSLT document() 函数

XSL/XSLT
XSL 语言
XSLT 介绍
XSLT 浏览器
XSLT 转换
<xsl:template>
<xsl:value-of>
<xsl:for-each>
<xsl:sort>
<xsl:if>
<xsl:choose>
<xsl:apply-templates>
XSLT - 客户端
XSLT - 服务器端
XSLT - 编辑XML
XSLT 摘要
XSLT 元素参考
XSLT 函数
XSL 编辑器

XSL/XSLT 中的 XSLT document() 函数


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 227 ::
收藏到网摘: n/a

Definition and Usage
定义和用法

The document() function is used to access nodes in an external XML document. The external XML document must be valid and parsable.
document() 函数的作用是:访问扩展XML文档中的节点。该扩展XML文档必须是有效的,并且可以被解析。

One way to use this function is to look up data in an external document. For example we want to find the Celsius value from a Fahrenheit value and we refer to a document that contains some pre-computed results:
<xsl:value-of select="document('celsius.xml')/celsius/result[@value=$value]"/>

下面列出了使用该函数在一个扩展文档中查找数据的方法。在这个案例中我们希望从 Fahrenheit [华氏度]值中找出Celsius[摄氏度]值,并提交一些包含预处理结果的文档,具体如下:
<xsl:value-of select="document('celsius.xml')/celsius/result[@value=$value]"/>


Syntax
语法

node-set document(object,node-set?)

Parameters
参数

参数 描述
object Required. Defines an URI to an external XML document
必要参数。定义一个链接到XML文档的URI
node-set Optional. Used to resolve relative URI
可选参数。用于释放相对URI

评论 (0) All

登陆 | 还没注册?