RE: XPath 2.0: Conditional Expression (Was Re: [xsl] XQuery 1.0 and XPath 2.0 Functions and Operators Version 1.0)

Subject: RE: XPath 2.0: Conditional Expression (Was Re: [xsl] XQuery 1.0 and XPath 2.0 Functions and Operators Version 1.0)
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Fri, 7 Sep 2001 22:44:58 +0100
> Another XPath 2.0 requirement that doesn't seem to be present in the
> F&O WD is 2.2 "Must Provide a Conditional Expression". I imagined that
> conditional expressions would be supported with an operator, something
> like:
>
>   boolean-expression ? true-expression : false-expression
>
> Is this functionality going to appear in a different document?

Yes. The F&O document is intended only to contain pure functions and
operators, that is things that evaluate all their operands/arguments and
then produce a result that depends on their values. (Admittedly it currently
contains some things that don't quite meet these criteria, e.g. "and" and
"or"). Constructs like "a/b" and "a[b]" and if-then-else don't fall into
this pattern, and will be described as part of the built-in semantics of the
language.

To save you guessing, the current thinking for the syntax of conditional
expressions is

if (condition) then expression-1 else expression-2

Mike Kay


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


Current Thread