xsl-list
[Top] [All Lists]

Re: [xsl] Saxon bug in short-circuiting of expressions?

2006-07-24 20:54:25
Michael Kay <mike(_at_)saxonica(_dot_)com> writes:

[quoting a stylesheet in an earlier posting from me]

  <xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
    <xsl:output method="text"/>
    <xsl:template match="/">
      <xsl:if test="function-available('hoge') and 
hoge()">moge</xsl:if>
    </xsl:template>
  </xsl:stylesheet>

The function hoge() is not in a namespace. Therefore it has to be a system
function, not an extension function. Referring to a system function that
doesn't exist is a static error, that is, it doesn't depend on whether the
function call is actually executed or not.

OK, I see that now.

For system functions the relevant statement is at the end of section 4:

"the function library consists of the core function library together with
the additional functions defined in [12 Additional Functions] and extension
functions as described in [14 Extensions]; it is an error for an expression
to include a call to any other function"

OK.

However, if you change the xsl:stylesheet element to say version="2.0", then
forwards compatibility comes into play, and no error is reported, because of
the rule that you originally quoted.

With Saxon 6.5.5 in my environment, even after changing the value
of the version attribute to "2.0" (or any other value) in the
above stylesheet, I still get an "Unknown system function: hoge"
error, and the transformation fails.

  --Mike

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>