Re: [xsl] XPath 3.0 is a composable language ... what does that mean?

Subject: Re: [xsl] XPath 3.0 is a composable language ... what does that mean?
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Wed, 24 Oct 2012 12:29:33 +0100
On 24/10/2012 12:06, Costello, Roger L. wrote:
Hi Folks,

I read this in the XPath 3.0 specification:

XPath 3.0 is a composable language

What does that mean?



It means that every operator / language construct allows any expression to appear as its operand, subject only to operator precedence and data typing constraints. For example, you can do


3 + max(for $i in 1 to 10 return (if ($i gt 5) then $i*3 else $i*2)))

Contrast this with XSLT, which is not fully composable: XPath expressions can be used as operands to XSLT instructions, but not the other way around; similarly Java has constructs called statements that cannot be nested inside expressions.

Michael Kay
Saxonica

Current Thread