[XSLT 2.0] default namespace for element-available()

There's an oddity in the definition of element-available(), which is that it
uses the default namespace if the name is unprefixed.

There's some logic to this: you can write

<stylesheet xmlns="http://www.w3.org/XSL/Transform">

<template match="/">
  <if test="element-available('analyze-string')">...</if>
</template>

</stylesheet>

But since the argument to element-available is a lexical QName constructed
at run time, this actually means there's another value in the XSLT part of
the XPath dynamic context: yet another default namespace. This is the only
XPath construct that used the default namespace in XSLT 1.0.

We need to decide whether to keep this definition as it is, in which case
this default namespace ought to be included in the table in section 2.5.2,
or whether to change the definition, with a small risk of backwards
incompatibility. Since element-available() exists in good measure for
compatibility reasons, I think we probably shouldn't change the spec.

Michael Kay 

Received on Monday, 29 March 2004 14:43:20 UTC