This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 30241 - [XSLT30] Section on dynamic context named functions has a Note that seems at odds with the definition
Summary: [XSLT30] Section on dynamic context named functions has a Note that seems at ...
Status: NEW
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 (show other bugs)
Version: Recommendation
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-01 16:31 UTC by Abel Braaksma
Modified: 2019-02-15 16:31 UTC (History)
0 users

See Also:


Attachments

Description Abel Braaksma 2018-04-01 16:31:32 UTC
Section 5.3.3.2 says, under 2nd bullet point:

> The named functionsXP30 (representing the functions accessible using 
> function-available or function-lookupFO30) include all the functions 
> available in the static context, and may also include an additional 
> implementation-defined set of functions that are available dynamically 
> but not statically. 
Then a Note follows:

> This set therefore includes some functions that are not available for 
> dynamic calling using xsl:evaluate, for example stylesheet functions whose 
> visibility is private, and XSLT-defined functions such as current and key. 

I don't quite understand this. This section describes that all static functions are available dynamically, and then says it has them, but doesn't?

I'm sure this was discussed, but I can't remember the conclusion. When I read on under xsl:evaluate it clearly states that fn:current, fn:key are not available there.

But the section above suggests that they *are* available through function-lookup.

If I take this to the letter it seems that:

* function-available and function-lookup from xsl:evaluate should succeed on all functions, including the ones defined in the XSLT REC (fn:current and the like)
* but then *invoking* the found function should lead to a function-not-found error (or something), since xsl:evaluate does not disclose the implementation of that function?
* since function-available is defined in the XSLT REC, this would apply only to function-lookup (I think :S)

I remember that we deliberately limited the availability of functions defined in the spec (except functions in the map-namespace, I think). That limitation also applies to shadow attributes AVT's and xsl:use-when. I'm not saying we change that, but I find it hard to get to a proper understanding of how this is supposed to work.

My main issue is with "it includes all functions" and then "it doesn't include all functions". 

What further confuses is the next Note which says that XPath stipulates that whatever is available in the static context is available in the dynamic context. But it isn't, it seems.

I don't think the spec is broken here, but I do find it confusing how it is defined (and yes, I do remember we had several discussions on the subject, so my apologies for bringing it up again).
Comment 1 Michael Kay 2019-02-15 16:31:43 UTC
I think the first point to be clear on here is that section 5.3 defines the static and dynamic context for "ordinary" XPath expressions in the stylesheet". Static expressions, and expressions evaluated using xsl:evaluate, have different rules, and it would be better if 5.3 said so clearly, up front.

With that clarification, I do not see any need for further changes.