[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Functional programming in XSLT (revised)

Subject: Re: Functional programming in XSLT (revised)
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Fri, 16 Mar 2001 10:20:04 +0000
xslt conditional operator
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.