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 1248 - function-available and compile time errors (editorial)
Summary: function-available and compile time errors (editorial)
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 2.0 (show other bugs)
Version: Last Call drafts
Hardware: PC Windows 2000
: 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: 2005-04-14 10:23 UTC by David Carlisle
Modified: 2005-07-21 18:50 UTC (History)
0 users

See Also:


Attachments

Description David Carlisle 2005-04-14 10:23:16 UTC
http://www.w3.org/TR/xslt20/#function-function-available

says
The function-available function can be used with the xsl:choose and xsl:if
instructions,...

There probably should be a warning (either here or in the existing note at the
end of that section) that using xsl:choose or xsl:if to mark a conditional block
of code is unsafe as you may get compile time errors even in the branches that
will not be executed.

This came up on comp.text.xml this week where a user was trying to use msxml
node set with msxml and native temporary tree with saxon 8 but saxon 
died on the unknown msxsl:node-set function even though it was protected by an
xsl:choose, addition of some xsl:use-when tests solved the original poster's
problem, but I think that a note here would help (assuming the users read notes
in the spec:-)

Another minor comment on function-available, most references to the use of this
function use the idiom
a string that is a valid QName, 
but 10.3 Stylesheet Functions says:

If a stylesheet function has been defined with a particular expanded-QName,
then a call on function-available will return true when called with an
argument that is a QName that expands to this same expanded-QName.
         ^^^^^^^^^^^^^^^^^

which probably isn't quite so clear/accurate.

David
PS, for your records I leave both these points to the editor and accept the
resolution, whatever.
Comment 1 Michael Kay 2005-05-07 22:34:03 UTC
Thanks for these comments, David. The XSL WG reviewed them and asked the editor
to revise the text to fix the problems identified. This I have done. In the
intro to function-available, I have retained the reference to use-when and have
dropped the reference to choose/if. I've then added two examples, one showing
use of function-available with xsl:choose to achieve portability between XSLT
1.0 and 2.0, and a second example showing function-available with use-when to
achieve portability between 2.0 and a future XSLT version.

In the description of stylesheet functions, I've changed "QName" here to
"lexical QName".

Thankyou for you advance acceptance of the outcome!

Michael Kay
for the XSL WG