This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: XPath's role (Was: Re: Re: . in for)
- From: "Michael Kay" <michael dot h dot kay at ntlworld dot com>
- To: "'Jeni Tennison'" <jeni at jenitennison dot com>, "'Michael Kay'" <michael dot h dot kay at ntlworld dot com>
- Cc: <xsl-list at lists dot mulberrytech dot com>
- Date: Mon, 7 Jan 2002 22:03:07 -0000
- Subject: RE: XPath's role (Was: Re: [xsl] Re: . in for)
- Reply-to: xsl-list at lists dot mulberrytech dot com
>
> 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