[Bug 29251] New: [xslt30] Conformance and optional features

https://www.w3.org/Bugs/Public/show_bug.cgi?id=29251

            Bug ID: 29251
           Summary: [xslt30] Conformance and optional features
           Product: XPath / XQuery / XSLT
           Version: Last Call drafts
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSLT 3.0
          Assignee: mike@saxonica.com
          Reporter: mike@saxonica.com
        QA Contact: public-qt-comments@w3.org
  Target Milestone: ---

In reviewing the section of the specification on conformance and optional
features, the WG noted today:

(1) The section 3.5.8 "Using an XQuery Library Package" has never been
specified with sufficient precision to allow interoperable testing, and (b) the
new load-xquery-module() function in XPath 3.1 is probably a better (and
certainly a more interoperable) solution to the underlying requirement. The WG
therefore proposes to drop this feature and the associated XQuery Invocation
Feature.

(Note: the function load-xquery-module() will be available in every processor
that provides the XPath 3.1 feature and the higher-order-function feature. But
under the rules of the function itself, the implementation is allowed to raise
a dynamic error FOQM0006 if no suitable XQuery processor is available, and it
is free to do this on every invocation if it wishes.)

(2) In XQuery 3.0 (and 3.1), higher-order-functions are an optional feature of
the specification. XPath does not call out subsets of the XPath language to be
treated as optional, but instead expects this to be defined in host languages.
It has always been the WG's intent to make the feature optional but the
specification does not state this.

The definition of the higher-order-functions optional feature can be based
directly on the definition in XQuery 3.1, which is as follows:

<quote>
An implementation that does not provide the Higher-Order Function Feature MUST
raise a static error [err:XQST0129] if it encounters a TypedFunctionTest, named
function reference, inline function expression, or partial function
application. The effect of this rule is that it is impossible to construct
function items other than maps and arrays. Dynamic function calls are
permitted, but the function that is called will necessarily be a map or array.
The AnyFunctionTest sequence type is permitted and will match either a map or
array. Such an implementation MAY raise a type error [err:XPTY0004] if an
expression evaluates to a sequence that contains a function.

If an implementation provides the Higher-Order Function Feature, then it must
provide all higher-orderFO31 functions defined in [XQuery and XPath Functions
and Operators 3.1]. If an implementation does not provide the Higher Order
Function Feature, a static error is raised [err:XPST0017] if any of these
functions is present in a query.
</quote>

Note: the functions classified as "higher-order" (for example fn:filter,
fn:fold-left, etc) were enumerated in the XQuery 3.0 version of the
specification, but in 3.1 the specification of each such function in F+O
carries an annotation labelling it as higher-order, and the conformance
statement refers to these labels.

Recasting the rule into the form used in the XSLT specification gives the
following definition:

27.X Higher-Order Functions Feature

[Definition: An implementation that provides the Higher-Order Function feature
provides constructs allowing the creation of functions as items in the data
model, and invocation of such functions.]

More specifically: an implementation that does not provide the Higher-Order
Function Feature MUST raise a static error [err:TBA] if it encounters a
TypedFunctionTest, named function reference, inline function expression, or
partial function application. The effect of this rule is that in such an
implementation, it is impossible to construct function items other than maps
and arrays. Dynamic function calls are permitted, but the function that is
called will necessarily be a map or array. The AnyFunctionTest sequence type is
permitted and will match either a map or array.

An implementation that does not provide the higher-order function feature
constrains the data model by disallowing function items other than maps and
arrays. Such a processor must raise a dynamic error [err:TBA] if the input to
the processor includes a function item other than a map or array.

Note: see the notes for the analogous error condition XTSE1665.

An implementation that does not provide the Higher-Order Function feature
excludes from the static context of all XPath expressions those functions which
are labeled in F+O 3.1 as having the higher-order property (for example,
filter, for-each, fold-left, function-lookup, etc). Calling function-available
on these functions returns false.



To fn:system-property() we add the property name xsl:supports-function-items
which returns "yes" if and only if the processor provides the
higher-order-function feature.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Thursday, 29 October 2015 19:36:27 UTC