This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Functional programming in XSLT (revised)
- To: Alexey Gokhberg <alexei at bluewin dot ch>
- Subject: Re: [xsl] Functional programming in XSLT (revised)
- From: Jeni Tennison <mail at jenitennison dot com>
- Date: Fri, 16 Mar 2001 10:20:04 +0000
- CC: xsl-list at lists dot mulberrytech dot com
- Organization: Jeni Tennison Consulting Ltd
- References: <3AB1DACE.4F83@bluewin.ch>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi Alexey,
Just a couple of comments.
> The <fxsl:function> declarations are allowed at any place, where
> <xsl:variable> declarations are allowed. In particular, function
> declarations can be top-level or local to a template. Furthermore,
> function declarations may be embedded into another function
> declarations.
I was thinking about this after reading your last proposal - local
function declarations in the same way as you get local variables. I
quite like it (it has a symmetry) but I couldn't think of why I'd ever
need it. Have you got a use case in mind? Or is it to make the
lambda thing easier?
> 3. Conditional operator in XPath
> --------------------------------
>
> The conditional operator is added to XPath. The proposed syntax is
>
> if TEST then CONSEQUENT else ATERNATE
>
> where "if", "then" and "else" are "reserved words", and "TEST",
> "CONSEQUENT" and "ALTERNATE" are XPath expressions.
David had this syntax for a while and I bugged him mercilessly about
it. He changed it to:
if (TEST) then (CONSEQUENT) else (ALTERNATE)
when he identified that:
if $test then / else /foo
would be parsed as:
if $test then (/else/foo)
and cause an error in the XPath parser despite the fact that it's a
perfectly legal conditional operator.
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list