Bug 20843 - [XT3TS] function-1902
Summary: [XT3TS] function-1902
Status: REOPENED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 Test Suite (show other bugs)
Version: Candidate Recommendation
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Abel Braaksma
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-01 11:09 UTC by Tim Mills
Modified: 2015-07-30 19:16 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Mills 2013-02-01 11:09:10 UTC
This test looks up function names, such as fn:nilled, but 'fn' is not an in-scope namespace prefix.
Comment 1 Michael Kay 2013-02-04 22:52:56 UTC
Updated the test to match the revised input document.
Comment 2 Tim Mills 2013-02-05 16:59:55 UTC
Thanks.
Comment 3 Tim Mills 2015-03-23 16:07:36 UTC
The intent of this test is to

"Test that all functions defined in the F+O 3.0 specification are NOT implemented in a 2.0 processor."

It expects that no "missing-function" elements will be generated.

A missing-element is generate if a function in the 'fn' namespace is _not_ available.


      <xsl:if test="if(@name/starts-with(., 'op')) then function-available(@name, @arity) else not(function-available(@name, @arity))">
            <missing-function name="{@name}" arity="{@arity}"/>
            <xsl:message expand-text="yes">*** Missing function name={@name} arity={@arity}</xsl:message>
        </xsl:if>

For the input line:

   <function name="fn:node-name" arity="0"/>

one would expect an XSLT 2.0 processor to return false for

function-available("fn:node-name", 0)

and therefore this would generate a missing-function element in the output and therefore the assertion 

     <assert>empty(/out/*)</assert>

would fail.

The input data also includes some functions which have been moved from XSLT 2.0 into F&O 3.0 (e.g. format-number).
Comment 4 Abel Braaksma 2015-03-31 01:28:01 UTC
Thanks for reopening this bug-report. I've fixed as follows:

* Added XSLT 2.0 functions (so that they can be excluded)
* Updated the autogen XSLT file (based on the spec XML)
* Fixed some other minor errors (wrong path) in all three autogen XSLT
* Changed the test to create useful XML output and changed the assertion to match it
* Changed version from 3.0 to 2.0

Running it now against Saxon in 2.0 mode shows that at least my version of Saxon supports the math functions and some newly added constructor functions from XP30.

I believe the list of functions is now comprehensive and correct, but I have not checked them one by one against all three specs (they are generated).
Comment 5 Abel Braaksma 2015-05-06 21:21:49 UTC
Was resolved > 30 days ago, closing.
Comment 6 Michael Kay 2015-07-30 19:16:51 UTC
This test requires an XSLT 2.0 processor to reject calls on 3.0 functions such as math:sin or fn:has-children.

I can find nothing in the XSLT 2.0 specification that requires this.

Firstly, calls such as math:sin are definitely legal. If the processor chooses to implement an extension function of this name in this namespace, there is nothing in the spec to prevent it.

I thought there might be something to prevent the processor adding extension functions in the FN namespace, but this too appears to be legal.

The spec mandates (in 3.2 Reserved namespaces) that "Reserved namespaces must not be used... in the names of stylesheet-defined objects such as variables and stylesheet functions." But there is nothing to prevent their use for extension functions. This may well be an oversight, but we're dealing here with the spec as written.

(From a practical perspective, my "XSLT 2.0" processor is actually a 3.0 processor running with certain functionality disabled. I have to decide what to disable, and I want to disable only what the 2.0 spec strictly requires me to disable. I don't think it requires me to disable these functions.)