RE: XPath's role (Was: Re: [xsl] Re: . in for)

Subject: RE: XPath's role (Was: Re: [xsl] Re: . in for)
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Mon, 7 Jan 2002 22:03:07 -0000
>
> Taking the basic example:
>
>   for $item in $sequence return some:function($item)
>
> is equivalent to:
>
> <xsl:function name="my:for">
>   <xsl:param name="sequence" type="item*" />
>   <xsl:result select="if (empty($sequence))
>                       then ()
>                       else (my:function($sequence[1]),
>                             my:for($sequence[position() > 1]))" />
> </xsl:function>
>
OK, I'll change the rules. If removing range variables means that to achieve
simple things, people have to write recursive functions, then I'd rather
keep range variables!

Two reasons: Usability and Optimization. You can argue with both, of course,
but I think the solutions using range variables are more manageable both for
implementors and for users, especially the sort of users who've written a
bit of SQL.

Mike Kay


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread