<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>20843</bug_id>
          
          <creation_ts>2013-02-01 11:09:10 +0000</creation_ts>
          <short_desc>[XT3TS] function-1902</short_desc>
          <delta_ts>2016-02-18 13:49:37 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>XSLT 3.0 Test Suite</component>
          <version>Candidate Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Tim Mills">tim</reporter>
          <assigned_to name="Abel Braaksma">abel.online</assigned_to>
          <cc>abel.braaksma</cc>
    
    <cc>mike</cc>
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>82470</commentid>
    <comment_count>0</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2013-02-01 11:09:10 +0000</bug_when>
    <thetext>This test looks up function names, such as fn:nilled, but &apos;fn&apos; is not an in-scope namespace prefix.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82550</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2013-02-04 22:52:56 +0000</bug_when>
    <thetext>Updated the test to match the revised input document.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82593</commentid>
    <comment_count>2</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2013-02-05 16:59:55 +0000</bug_when>
    <thetext>Thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>118873</commentid>
    <comment_count>3</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2015-03-23 16:07:36 +0000</bug_when>
    <thetext>The intent of this test is to

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

It expects that no &quot;missing-function&quot; elements will be generated.

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


      &lt;xsl:if test=&quot;if(@name/starts-with(., &apos;op&apos;)) then function-available(@name, @arity) else not(function-available(@name, @arity))&quot;&gt;
            &lt;missing-function name=&quot;{@name}&quot; arity=&quot;{@arity}&quot;/&gt;
            &lt;xsl:message expand-text=&quot;yes&quot;&gt;*** Missing function name={@name} arity={@arity}&lt;/xsl:message&gt;
        &lt;/xsl:if&gt;

For the input line:

   &lt;function name=&quot;fn:node-name&quot; arity=&quot;0&quot;/&gt;

one would expect an XSLT 2.0 processor to return false for

function-available(&quot;fn:node-name&quot;, 0)

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

     &lt;assert&gt;empty(/out/*)&lt;/assert&gt;

would fail.

The input data also includes some functions which have been moved from XSLT 2.0 into F&amp;O 3.0 (e.g. format-number).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>119116</commentid>
    <comment_count>4</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2015-03-31 01:28:01 +0000</bug_when>
    <thetext>Thanks for reopening this bug-report. I&apos;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).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>120197</commentid>
    <comment_count>5</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2015-05-06 21:21:49 +0000</bug_when>
    <thetext>Was resolved &gt; 30 days ago, closing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>122331</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2015-07-30 19:16:51 +0000</bug_when>
    <thetext>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 &quot;Reserved namespaces must not be used... in the names of stylesheet-defined objects such as variables and stylesheet functions.&quot; But there is nothing to prevent their use for extension functions. This may well be an oversight, but we&apos;re dealing here with the spec as written.

(From a practical perspective, my &quot;XSLT 2.0&quot; 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&apos;t think it requires me to disable these functions.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>122478</commentid>
    <comment_count>7</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2015-08-06 00:15:36 +0000</bug_when>
    <thetext>The intent of this test is to check if a 2.0 and 3.0 processor has the &quot;proper&quot; set of functions. From your comment, I think there is no way to test this using the approach used in the test.

I agree that any functions inside unknown non-reserved namespaces of XSLT 2.0 or XPath 2.0 should be considered extension functions.

I remember that I have seen a restriction in XPath 2.0 (or 3.0?) where expansion of functions in the function namespace was not allowed, discussed at some point in the XSLWG with regards to the XSLT function in the XPath function namespace. However, I cannot find this back.

In XSLT 3.0 we have a provision that all possible functions *not* in the XPath reserved namespace are mapped to an error function, to allow backwards compatible processing. It&apos;s an edge case, but such backwards compatible processing may lead to different results if different implementations have differing sets of known function signatures.

That said, I think it is preferable to allow processors to have extension functions in the reserved namespaces for precisely the reason you mention in comment#6, last para.

I am not sure it makes sense to maintain this test the way it is written, though it has helped us find gaps and overlap where we accidentally marked certain functions with the wrong version attribute internally.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>123852</commentid>
    <comment_count>8</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2015-10-22 14:34:21 +0000</bug_when>
    <thetext>The stylesheet is marked as 2.0, but uses the &quot;expand-text&quot; attribute.

                &lt;xsl:message expand-text=&quot;yes&quot;&gt;*** This function should NOT be available in XSLT 2.0 processors: name={@name} arity={@arity}&lt;/xsl:message&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125091</commentid>
    <comment_count>9</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2016-02-16 13:58:02 +0000</bug_when>
    <thetext>As discussed during F2F 2016 in Prague, fixed by removing the expand-text attribute.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125141</commentid>
    <comment_count>10</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2016-02-18 13:49:37 +0000</bug_when>
    <thetext>Confirmed fixed.  Thanks.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>