[Bug 1248] New: function-available and compile time errors (editorial)

http://www.w3.org/Bugs/Public/show_bug.cgi?id=1248

           Summary: function-available and compile time errors (editorial)
           Product: XPath / XQuery / XSLT
           Version: Last Call drafts
          Platform: PC
        OS/Version: Windows 2000
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSLT 2.0
        AssignedTo: mike@saxonica.com
        ReportedBy: davidc@nag.co.uk
         QAContact: public-qt-comments@w3.org


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.

Received on Thursday, 14 April 2005 10:23:17 UTC