[英]What does a hash (#) followed by a number mean in XSLT?
For example, the #1 in: 例如,#1中:
f:is-subordinate($M, $E, f:direct-reports#1)
from http://www.w3.org/TR/xslt-30/#d7e22590 来自http://www.w3.org/TR/xslt-30/#d7e22590
This is called the arity, and it's the number of parameters required by a function. 这称为arity,它是函数所需的参数数量。 If you don't have any hash (#), the arity of the function is 0.
如果没有任何哈希(#),则该函数的arity为0。
Here, it refers to a direct-reports
function which take a single parameter. 这里,它指的是采用单个参数的
direct-reports
功能。
With arity, you can have several functions with the same name, but a number of parameters which differs. 使用arity,您可以使用多个具有相同名称的函数,但有许多参数不同。
The example you point to is a higher-order function that takes another function as a parameter. 您指向的示例是一个高阶函数,它将另一个函数作为参数。 The
f:direct-reports#1
denotes the function named f:direct-reports
that takes 1 argument - the number after the hash is referred to as the function's arity - and this function#arity
syntax is the way you refer to the function itself as a first-class object, as opposed to calling the function and making use of its return value. f:direct-reports#1
表示名为f:direct-reports
的函数f:direct-reports
,它接受1个参数 - 哈希之后的数字称为函数的arity - 而这个function#arity
语法就是你引用函数本身的方式作为第一类对象,而不是调用函数并利用其返回值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.