Re: [xsl] function-available() test on stylesheet functions

Subject: Re: [xsl] function-available() test on stylesheet functions
From: "John McGowan" <john@xxxxxxxxxxxxx>
Date: Tue, 17 Jul 2007 15:40:40 -0500
I'm specifically asking about "stylesheet functions"

http://www.w3.org/TR/xslt20/#dt-stylesheet-function

or I suppose they could also be refered to as "user defined" functions.

I may have misstated the problem below. The real problem I'm having is this.

When calling function-available() inside of a  use-when attribute it
will never return true for a user defined function.  The specs pretty
much say this exactly.

http://www.w3.org/TR/xslt20/#conditional-inclusion

"Note that stylesheet functions  are not included in the context,
which means that the function function-available  will return false in
respect of such functions."

So, the combination of using @use-when, and funcion-available() wont
work for a user defined function, so is there some other way to do it?

/John

On 7/17/07, Abel Braaksma <abel.online@xxxxxxxxx> wrote:
Just tried

<xsl:value-of select="function-available('document')" />

which is an xslt function and which does return true....

I used XSLT 2 / Saxon 8.9. You?

John McGowan wrote:
> I was trying to use function-available() to try to determine if a
> stylesheet function had been defined.  I eventually figured out that
> stylesheet functions are not in the proper context to cause
> function-available() to ever be true.
>
> So my question is, is there another way to test to see if a stylesheet
> function exists?




--
/John

Current Thread