[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] When to use conditional constructions?


Subject: Re: [xsl] When to use conditional constructions?
From: Graydon <graydon@xxxxxxxxx>
Date: Mon, 31 Mar 2014 12:40:30 -0400

On Mon, Mar 31, 2014 at 05:15:46PM +0100, David Carlisle scripsit:
> On 31/03/2014 17:08, Michael Kay wrote:
> >>While we're extending XPath, can we have support for named,
> >>referenceable predicate definitions?
> >
> >Isn't that the same thing as a function?
> 
> Yes, but you didn't quote the important bit:
> 
> >-- Graydon, who is going to be embarrassed if that's snuck into 3.0
> 
> Function definitions have in fact snuck in to XPath 3 by way of the let
> clause and inline function definitions.

Does that give me a way to use the same definition in multiple XPath
expressions with a definition in one place?  Inline functions are
anonymous, and any "let $localFunction := function...." I'd expect to
stay stuck in the context of that particular XPath expression --

3.10 says "The scope of a variable bound in a let expression comprises
all subexpressions of the let expression that appear after the variable
binding. "

-- so I wouldn't expect to be able to use the same definition in multiple match
attributes without defining it each time, which isn't helpful on the
"define in one place, debug, use with confidence" front.

-- Graydon


Current Thread
Keywords