[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] New XSLT 3.0 Working Draft


Subject: Re: [xsl] New XSLT 3.0 Working Draft
From: Ihe Onwuka <ihe.onwuka@xxxxxxxxxxxxxx>
Date: Wed, 11 Jul 2012 15:44:26 +0100

On Wed, Jul 11, 2012 at 11:31 AM, Michael Kay <mike@xxxxxxxxxxxx> wrote:

>
> If f is a function that takes two arguments and adds them, so that f(2,3) is
> 5, then f(?,1) is a function that takes a single argument and adds one to
> it.
>
> You might write this as
>
> <xsl:variable name="fAdd"
>    select="function($x as xs:integer, $y as xs:integer) as xs:integer {$x +
> $y}"/>
> <xsl:variable name="fIncrement" select="$fAdd(?, 1)"/>
> <xsl:value-of select="$fIncrement(4)"/>
>
> which would output "5".
>

Ah hah..... ? stands for an unsupplied argument. Cheers.
> Michael Kay
> Saxonica


Current Thread