You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by drkm <da...@yahoo.fr> on 2005/10/17 15:31:55 UTC
EXSLT 'function' error
Hi
I have a trouble with the following XSLT script:
<?xml version="1.0"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:func="http://exslt.org/functions"
xmlns:my="..."
extension-element-prefixes="my func">
<func:function name="my:nil">
<xsl:param name="attr"/>
<func:result select="not($attr) or ($attr/@xsi:nil='true')"/>
</func:function>
<xsl:template match="/">
<xsl:message>
<xsl:text>root: </xsl:text>
<xsl:value-of select="my:nil(root)"/>
<xsl:text> elem: </xsl:text>
<xsl:value-of select="my:nil(root/elem)"/>
</xsl:message>
</xsl:template>
</xsl:stylesheet>
With the following XML document:
<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<elem xsi:nil="true"/>
</root>
the expected results are first 'false' and second 'true'. But they are
both 'false'. If I directly use the XPath expression from the
'func:function' in the 'xsl:value-of', all is ok. It is ok also if I
use:
"($attr/@xsi:nil='true') or not($attr)"
in place of:
"not($attr) or ($attr/@xsi:nil='true')"
Tested with Xalan 2.4.1 and 2.7.0.
Thanks,
--drkm
___________________________________________________________________________
Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger
Téléchargez cette version sur http://fr.messenger.yahoo.com