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 24970 - Non-contextual function calls definition misinterprets the Core functions definition
Summary: Non-contextual function calls definition misinterprets the Core functions def...
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 (show other bugs)
Version: Last Call drafts
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: 2014-03-07 13:05 UTC by Abel Braaksma
Modified: 2014-05-15 14:00 UTC (History)
0 users

See Also:


Attachments

Description Abel Braaksma 2014-03-07 13:05:16 UTC
The definition of Non-contextual function calls [1] says:

[Definition: The term non-contextual function call is used to refer to function calls that do not pass the dynamic context to the called function. This includes all calls on stylesheet functions and all dynamic function invocationsXP30, (that is calls to function items as permitted by XPath 3.0). It does not include calls to all core functions in particular those that explicitly depend on the context, such as the current-group and regex-group functions. It is implementation-defined whether, and under what circumstances, calls to extension functions are non-contextual.]

The problem is with the penultimate sentence: "It does not include calls to all core functions [...] such as current-group and regex-group".

The mentioned functions are not part of the core functions, which are currently defined _not_ to include XSLT-only functions in the function namespace:

[Definition: The core functions are: functions specified in [Functions and Operators] in either the standard function namespace or the namespace http://www.w3.org/2005/xpath-functions/math; plus functions defined in this specification in namespace http://www.w3.org/2005/xpath-functions/map.]

It is probably better to refer to contextual functions from the F&O spec. Or, conversely, to add and mention the non-contextual functions that are not in Core Functions, but are in the XSLT spec, which I think are only those:

- one-argument functions fn:copy-of and fn:snapshot.
- two-argument function fn:document
- three-argument fn:deep-equal (see also bug 24968)
- two-argument fn:collation-key (see also bug 24968)
- any map: function (but these are already in core functions)

--------------------

Similarly the first use of the term Core Functions in 5.4.1 Initializing the Static Context [2], bullet four, only mentions the non-necessity of using the fn: prefix for core functions, while it is also non-mandatory for functions in that namespace defined in the XSLT spec.

--------------------

Similarly (but less intrusive) is the mention of Core Functions under 13.4 The Unicode Collation Algorithm [3], third para, second sentence. This sentence mentions the use of the collation argument in core functions, but does not include the collation argument in functions in the XSLT spec.



[1] http://www.w3.org/TR/xslt-30/#dt-non-contextual-function-call
[2] http://www.w3.org/TR/xslt-30/#static-context
[3] http://www.w3.org/TR/xslt-30/#uca-collations
Comment 1 Michael Kay 2014-03-07 21:12:19 UTC
Yes you are right. I thought that "core functions" now included XSLT-defined functions  as a consequence of the resolution of bug #24521; but it does not.
Comment 2 Abel Braaksma 2014-03-26 18:33:33 UTC
Tony Graham wrote on the XSL list[1] about another spot in the spec where the term core functions were not used correctly:

The 'Statically known function signatures' are[2]:

   The core functions defined in [Functions and Operators],
   together with the functions element-available,
   function-available, type-available, and system-property
   defined in this specification, plus the set of extension
   functions that are present in the static context of
   every XPath expression (other than a use-when expression)
   within the content of the element that is the parent of
   the use-when attribute.


I suggest we remove "defined in [Functions and Operators], because the definition in Core Functions is wider than that (it also includes map functions defined in the XSLT spec).


----------------------------
NOTE: for reference and historical accuracy, at the moment that I write this, the definition of Core Functions [3] has been updated in the internal draft to the following (it used to only include the standard fn namespace):

"[Definition: The core functions are: functions specified in [Functions and Operators] in either the standard function namespace or the namespace http://www.w3.org/2005/xpath-functions/math; plus functions defined in this specification in namespace http://www.w3.org/2005/xpath-functions/map.]"



[1] Tony's question and my answer: http://markmail.org/message/tpsdbz2tzh3bzbqi
[2] https://www.w3.org/TR/xslt-30/#static-expression
[3] http://www.w3.org/TR/xslt-30/#dt-core-function
Comment 3 Michael Kay 2014-03-28 11:32:52 UTC
Fixed. I have kept the definition of "core functions" unchanged, but have changed all uses of the term that don't match this definition.

As part of this fix, I changed the definition of available functions in the static context to refer to the visibility rules for stylesheet functions.