[Bug 3772] [XSLT 2.0] function-available cannot be used to detect extension functions

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

           Summary: [XSLT 2.0] function-available cannot be used to detect
                    extension functions
           Product: XPath / XQuery / XSLT
           Version: Candidate Recommendation
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSLT 2.0
        AssignedTo: mike@saxonica.com
        ReportedBy: colin@colina.demon.co.uk
         QAContact: public-qt-comments@w3.org


Section 18.1.1 claims that function-available() :
"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."

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('xsl:vendor') and
system-property('xsl:product-version').

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.

Received on Wednesday, 27 September 2006 07:15:27 UTC