Hi Colin,
Testing with the latest CVS gives the following result:
V:\test\Adams>Xalan test1.xml test1.xsl
XSLT error: xsl:when not parented by xsl:choose. (test1.xsl, line 10,
column 53)
When I add the missing xsl:choose, I get the following:
V:\test\Adams>Xalan test1.xml test1.xsl
XSLT message: math:abs to be tested, source tree node: #document
(file:///V:/test/Adams/test1.xsl, line 7, column 18)
XSLT message: math:abs available, source tree node: #document
(file:///V:/test/Adams/test1.xsl, line 12, column 22)
<?xml version="1.0" encoding="UTF-8"?>
<transformed xmlns:test="urn:colina.demon.co.uk:domwriter-test-one"
xmlns:math="http://exslt.org/math" value="3"/>
I tested with Xalan 1.4 and the interim release and got the same results.
So, the bug is in your stylesheet, and the way you capture output from the
processor, because you missed the error message.
Dave
|---------+--------------------------->
| | Colin Paul Adams|
| | <[EMAIL PROTECTED]|
| | mon.co.uk> |
| | |
| | 03/04/2003 10:12|
| | PM |
|---------+--------------------------->
>--------------------------------------------------------------------------------------------------------------------------------|
|
|
| To: [email protected]
|
| cc: (bcc: David N Bertoni/Cambridge/IBM)
|
| Subject: function-available not working
|
>--------------------------------------------------------------------------------------------------------------------------------|
Well, it seems my problems with EXSLT were nothing of the kind.
The following transform does not produce any output (messages or a
document element) at all:
<?xml version='1.0'?>
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
xmlns:test="urn:colina.demon.co.uk:domwriter-test-one"
xmlns:math="http://exslt.org/math">
<xsl:template match="/">
<xsl:message>
<xsl:text>math:abs to be tested</xsl:text>
</xsl:message>
<xsl:when test="function-available('math:abs')">
<xsl:message>
<xsl:text>math:abs available</xsl:text>
</xsl:message>
<transformed value="{math:abs(-3)}" />
</xsl:when>
<xsl:otherwise>
<xsl:message>
<xsl:text>math:abs not available</xsl:text>
</xsl:message>
<nottransformed />
</xsl:otherwise>
</xsl:template>
</xsl:transform>
Is this a bug, or have I missed something?
(If I remove all the function-avaialble stuff, then it wouks as expected.)
--
Colin Paul Adams
Preston Lancashire