Re: Switch/case

On Wed, 2017-06-28 at 12:08 +0200, Steven Pemberton wrote:
> This led to me to realise that I would like switch/case to be a bit
> more  
> flexible: I'd like the cases to match on expressions.

See https://www.w3.org/TR/xquery-31/#id-switch for inspiration.
Also https://www.w3.org/TR/xslt-30/#element-choose for XSLT's version.

switch expressions didn't make it into XPath 3.1, although you can of
course have a chain of if/else expressions.

I like XSLT's use of <when test="..."> since XSLT specifies a
declarative mapping, not control flow.

Liam


-- 
Liam R. E. Quin <liam@w3.org>
The World Wide Web Consortium (W3C)

Received on Thursday, 29 June 2017 03:23:38 UTC