<?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>4696</bug_id>
          
          <creation_ts>2007-06-22 20:46:44 +0000</creation_ts>
          <short_desc>[XSLT 2.0] type-available() in use-when</short_desc>
          <delta_ts>2007-10-10 20:49:58 +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>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="Michael Kay">mike</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>15524</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2007-06-22 20:46:44 +0000</bug_when>
    <thetext>The stated intent of the type-available() function is to allow conditional logic to be included in use-when expressions. See 18.1.4: &quot;The type-available  function can be used, for example with the [xsl:]use-when attribute (see 3.12 Conditional Element Inclusion), to explicitly control how a stylesheet behaves if a particular schema type is not available in the static context.&quot;

The function returns true if the type is present in the in-scope schema type definitions for that expression.

However, the static context for a use-when expression (3.12) contains only &quot;The type definitions that would be available in the absence of any xsl:import-schema  declaration&quot; - that is, it contains no user-defined types.

This essentially makes the function (a very late addition to the spec) useless.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>15724</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2007-06-29 07:40:53 +0000</bug_when>
    <thetext>From the minutes of 29 Jun 2007:

Perhaps just add a note pointing out that user-defined types are not available (and so the function is not as useful as one might want)? Or a possible approach to a solution is that if module A imports a schema S, and then imports/includes module B, then the user-defined types of schema S are available for inspection within module B. Need to check how disruptive this would be to implementors.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>15733</commentid>
    <comment_count>2</comment_count>
    <who name="Colin Adams">colin</who>
    <bug_when>2007-07-02 15:26:26 +0000</bug_when>
    <thetext>The actual use case which drove the addition was the then inability to know if types such as xs:int were available to a basic XSLT processor.

Adding the function solved that problem, so it is not useless.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>15883</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2007-07-19 16:40:14 +0000</bug_when>
    <thetext>Decision on 19/7/2007 - we will essentially leave the spec as it is, and change the wording around it to make it clear what you can and can&apos;t achieve by using this facility.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17127</commentid>
    <comment_count>4</comment_count>
    <who name="Sharon Adler">sca.w3c</who>
    <bug_when>2007-10-10 20:48:54 +0000</bug_when>
    <thetext>M Kay to re-phrase descriptive text.  Keep type-available() function as written.  Descriptive text fixed as erratum E15</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>