This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 4696 - [XSLT 2.0] type-available() in use-when
Summary: [XSLT 2.0] type-available() in use-when
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 2.0 (show other bugs)
Version: Recommendation
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-22 20:46 UTC by Michael Kay
Modified: 2007-10-10 20:49 UTC (History)
0 users

See Also:


Attachments

Description Michael Kay 2007-06-22 20:46:44 UTC
The stated intent of the type-available() function is to allow conditional logic to be included in use-when expressions. See 18.1.4: "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."

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 "The type definitions that would be available in the absence of any xsl:import-schema  declaration" - that is, it contains no user-defined types.

This essentially makes the function (a very late addition to the spec) useless.
Comment 1 Michael Kay 2007-06-29 07:40:53 UTC
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.
Comment 2 Colin Adams 2007-07-02 15:26:26 UTC
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.
Comment 3 Michael Kay 2007-07-19 16:40:14 UTC
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't achieve by using this facility.
Comment 4 Sharon Adler 2007-10-10 20:48:54 UTC
M Kay to re-phrase descriptive text.  Keep type-available() function as written.  Descriptive text fixed as erratum E15