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

Re: [xsl] XSLT 3.0: Question about the rules for handling duplicate declarations of static variables


Subject: Re: [xsl] XSLT 3.0: Question about the rules for handling duplicate declarations of static variables
From: "Michael Kay mike@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 23 Nov 2014 22:54:57 -0000

On 23 Nov 2014, at 17:45, Dimitre Novatchev <dnovatchev@xxxxxxxxx> wrote:

>> The intended meaning of the phrase is "The value of the variable must not
be a sequence one of whose items is a function", or perhaps more formally, if
$V is the value of the variable then the expression
>>
>> some $v in $V satisfies $v instance of function(*)
>>
>> must be false.
>>
>> This is because it is not possible to determine whether two functions are
"the same"
>>
>
>
> Yes, makes perfect sense now.
>
> And this limitation is only for the case of name conflict with another
> static variable that precedes the current static variable in
> stylesheet-tree order, otherwise, if there is no such conflict, the
> value of a static variable/parameter is allowed to be a sequence
> containing a function, is this correct?
>

Correct, this constraint applies only when you have two variables with the
same name, so it's all about edge cases. (In real life, it's most likely to
happen if you import the same module twice. In this case there will be two
declarations and they will typically have the same value. But if the value is
a function, then we can't tell that it's the same value).

Michael Kay
Saxonica


Current Thread