"declare function f:t1($v1 as xs:integer, $v2 as xs:untypedAtomic*) { " +
" $v1 div $v2" +
"};" +
"10");
final UserFunction fn1 = exp1.getStaticContext().getUserDefinedFunction("f.ns", "t1", 2);
if (fn1 == null) {
throw new IllegalStateException("Function f:t1() not found");
}
final Controller controller = exp1.newController();
final Value[] arglist = new Value[2];
arglist[0] = new Int64Value(10);
for (int i = 3; i < 10; i++) {
arglist[1] = new Int64Value(i);
final ValueRepresentation result = fn1.call(arglist, controller);
System.out.println(arglist[0] + " div " + arglist[1] + " = " + result);
}
}