当前位置:K88软件开发文章中心编程语言XmlXPath01 → 文章内容

XPath、XQuery 以及 XSLT 函数

减小字体 增大字体 作者:佚名  来源:网上搜集  发布时间:2019-1-13 11:00:45

:("ab")fn:subsequence((item,item,...),start,len)返回 start 参数指定的位置返回项目序列,序列的长度由 len 参数指定。第一个项目的位置是 1。例子:subsequence(($item1, $item2, $item3,...), 3)结果:($item3, ...)例子:subsequence(($item1, $item2, $item3, ...), 2, 2)结果:($item2, $item3)fn:unordered((item,item,...))依据实现决定的顺序来返回项目。测试序列容量的函数名称说明fn:zero-or-one(item,item,...)如果参数包含零个或一个项目,则返回参数,否则生成错误。fn:one-or-more(item,item,...)如果参数包含一个或多个项目,则返回参数,否则生成错误。fn:exactly-one(item,item,...)如果参数包含一个项目,则返回参数,否则生成错误。Equals, Union, Intersection and Except 名称说明fn:deep-equal(param1,param2,collation)如果 param1 和 param2 与彼此相等(deep-equal),则返回 true,否则返回 false。合计函数名称说明fn:count((item,item,...))返回节点的数量。fn:avg((arg,arg,...))返回参数值的平均数。例子:avg((1,2,3))结果:2fn:max((arg,arg,...))返回大于其它参数的参数。例子:max((1,2,3))结果:3例子:max(('a', 'k'))结果:'k'fn:min((arg,arg,...))返回小于其它参数的参数。例子:min((1,2,3))结果:1例子:min(('a', 'k'))结果:'a'fn:sum(arg,arg,...)返回指定节点集中每个节点的数值的总和。生成序列的函数名称说明fn:id((string,string,...),node)Returns a sequence of element nodes that have an ID value equal to the value of one or more of the values specified in the string argumentfn:idref((string,string,...),node)Returns a sequence of element or attribute nodes that have an IDREF value equal to the value of one or more of the values specified in the string argumentfn:doc(URI) fn:doc-available(URI)如果 doc() 函数返回文档节点,则返回 true,否则返回 false。fn:collection()fn:collection(string) 上下文函数名称说明fn:position()返回当前正在被处理的节点的 index 位置。例子://book[position()<=3]结果:选择前三个 book 元素 fn:last()返回在被处理的节点列表中的项目数目。例子://book[last()]结果:选择最后一个 book 元素fn:current-dateTime()返回当前的 dateTime(带有时区)。fn:current-date()返回当前的日期(带有时区)。fn:current-time()返回当前的时间(带有时区)。fn:implicit-timezone()返回隐式时区的值。fn:default-collation()返回默认对照的值。fn:static-base-uri()返回 base-uri 的值。

上一页  [1] [2] [3] 


XPath、XQuery 以及 XSLT 函数