RE: [xsl] HOF in XPath/XSLT 2.1?

Subject: RE: [xsl] HOF in XPath/XSLT 2.1?
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 13 Oct 2009 23:35:33 +0100
> > The XSL WG has discussed this and is I think very likely to include 
> > higher-order functions in XSLT 2.1 and XPath 2.1, but the exact 
> > details are not yet decided (and indeed, the formal decision to go 
> > ahead is not yet made).
> Very interesting, and somewhat unexpected (I thought it would 
> be considered an overly powerful and complicated feature for 
> XPath, to be honest). I definitely hope it gets in, because 
> this would have one curious side effect specifically for 
> XPath: it will finally become possible to bind a variable to 
> a sequence from within XPath expression, same as what "let" 
> can do in XQuery. 

This workaround won't be needed, because "let" is being added to XPath 2.1

There's a real tension here: for a lot of XPath applications, XPath 2.0 is
already too big, and there's a strong desire to keep it small. But when
we're trying to decide whether some functionality should be provided through
XSLT syntax or XPath syntax, we tend to think in terms of what's most
effective for XSLT programmers, and that can mean making XPath bigger: other
constituencies with an interest in free-standing XPath are not well

Because we don't have full composability between XPath and XSLT, there's
also a tendency to duplicate functionality across the two languages - an
obvious example is conditional expressions, and we could easily end up
having syntax in both languages for creating anonymous local functions. I
don't particularly want to do that.


Michael Kay 

Current Thread