Patch #1414
closedrest argument catch-all for extension functions
0%
Description
SourceForge user: gschadow
O.K. here is the final installment to my work on Saxon
8.1.1 extension functions. This allows an extension
function to have a trailing formal argument of type
Expression[]. If that is the case, all remaining actual
arguments are bound to that expression array and can
be evaluated on demand under complete control of the
user function.
This patch depends on the deferred argument evaluation
(special form) patch.
I give an example in Function.java that are
demonstrated in demo/progncond.xsl
progn(expr1, expr2, ...) - fully evaluate all arguments
left to right and return the value of the last argument.
progi(i, expr1, expr2, ...) - fully evaluate all arguments
left to right and return the value of the i-th argument.
cond(c1,r1, c2,r2, ..., cn,rn) - determine the effective
boolean value of the conditions c1, c2, ... left to right
and return the value of the associated result expression
r1 or r2, ... respectively.
The demo shows a lot of the function of the closure
function as well, so the demo does depend on the user
closure function patch, but that is not essential to
demonstrate the work of progn, progi, and cond.
regards,
-Gunther
Files
Updated by Michael Kay over 11 years ago
- Status changed from New to Closed
Closed because it's unlikely this still works, it's unlikely anyone uses it, and the requirement is better met using XPath 3.0 higher order functions.
Please register to edit this issue