Loading TOC...

MarkLogic Server 11.0 Product Documentation
sc.functionParameterType

sc.functionParameterType(
   [arg as function(*)],
   [param as Number?]
) as schemaType()?

Summary

Returns the declared parameter type of a specific parameter of the function item as a schema component.

Parameters
arg The function item whose return type is to be returned. The default function item is used if no parameter is provided.
param The number of the parameter, 1 for the first, 2 for the second, and so on. If the param is out of range, the empty sequence is returned. The default is 1.

Example

var f = fn.functionLookup(xs.QName("sc:function-parameter-type"),2);
var b = [0, 1, 2, 3];
var res = [];
for (var a in b)
   { res.push(fn.concat("arg",a,"=",sc.functionParameterType(f,a))); };
res;

  =>
["arg0=","arg1=#xdmp:function","arg2=#xs:integer","arg3="]

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.