<?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>3772</bug_id>
          
          <creation_ts>2006-09-27 07:15:11 +0000</creation_ts>
          <short_desc>[XSLT 2.0] function-available cannot be used to detect extension functions</short_desc>
          <delta_ts>2006-10-24 10:47:01 +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 2.0</component>
          <version>Candidate Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</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="Colin Adams">colin</reporter>
          <assigned_to name="Michael Kay">mike</assigned_to>
          
          
          <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>12077</commentid>
    <comment_count>0</comment_count>
    <who name="Colin Adams">colin</who>
    <bug_when>2006-09-27 07:15:11 +0000</bug_when>
    <thetext>Section 18.1.1 claims that function-available() :
&quot;can be used with the [xsl:]use-when attribute (see 3.12 Conditional Element Inclusion) to explicitly control how a stylesheet behaves if a particular extension function is not available.&quot;

But this appears not to be the case to me.
The static context at use-when time will not include the extension functions (unless the implementor has decided that 1 or more of them should be added to the in-scope functions. I assume that this is to make them available for evaluating use-when expressions, so many (all, I would have thought - certainly in the case of my implementation that is so) extension functions will not be present.

So function-available() will return false for these functions, even though they will be available at compile-time proper, and at runtime.

This makes function-available() completely useless within use-when expressions (the set of extension functions available at use-when processing time can be determined by calling system-property(&apos;xsl:vendor&apos;) and system-property(&apos;xsl:product-version&apos;).

I think that simply looking at the in-scope functions is not what function-available() should do - it should look at all the core and XSLT-added XPath functions, plus all the extension functions that will be available at compile-time proper (or runtime), and return true or false accordingly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12082</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2006-09-27 10:20:47 +0000</bug_when>
    <thetext>I think the spec makes an unstated assumption that an extension function is present in the static context for use-when if and only if it is present in the static context for the relevant part of the stylesheet. We should state this assumption.

Suggested wording: in 3.12, in the table for static context components, in the entry for in-scope functions, change &quot;an implementation-defined set of extension functions&quot; to &quot;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&quot;.

Also add a note: this ensures that function-available returns true in respect of extension functions that can be called within the scope of the use-when attribute. It also has the effect that these extension functions will be recognized within the use-when attribute itself; however, the fact that a function is available gives no guarantee that a call on the function will succeed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12597</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2006-10-24 10:46:50 +0000</bug_when>
    <thetext>The change proposed in comment #1 was agreed by the WG on 4 Oct 2006. The spec has now been updated and the bug will therefore be closed.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>