You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Rainer Döbele <do...@esteam.de> on 2000/09/14 12:57:05 UTC
Bug in Xalan-Java with Node-conversion and Node-checks
Bug in Xalan-Java version 1.2.D01?
I am trying to use the following evaluation inside a template
<xsl:template match="field">
<xsl:param name="value"/>
<xsl:if test="$value/@id">[<xsl:value-of
select="$value/@id"/>]</xsl:if>
...
I can call this template e.g. with the following syntax:
<xsl:with-param name="value" select="."/>
However what I cannot do is to pass another parameter like this:
<xsl:param name="FIRSTNAME">rainer</xsl:param>
<!-- apply the template -->
<xsl:apply-templates select="field[@name='FIRSTNAME']">
<xsl:with-param name="value" select="$FIRSTNAME"/>
...
Xalan fails with the following exception message:
"process failed:Can not convert #RTREEFRAG to a NodeList!"
With the C-Version of calan this all works fine.
As a workaround I tried to check whether $value is a node at all.
But the check
<xsl:if test="$value::node()">...
results in another error.
Any comments and suggestions are appreciated.
Regards
Rainer
P.S. I have not been able to test this with Xalan-Java version 1.2.D02
because of another error.
__________________________________
ESTEAM-Software
Blarerstr. 56
78462 Konstanz
FON +49 7531 991216
e-mail doebele@esteam.de
__________________________________
Re: Bug in Xalan-Java with Node-conversion and Node-checks
Posted by Gary L Peskin <ga...@firstech.com>.
Rainer Döbele wrote:
>
> Bug in Xalan-Java version 1.2.D01?
>
> I am trying to use the following evaluation inside a template
>
> <xsl:template match="field">
> <xsl:param name="value"/>
> <xsl:if test="$value/@id">[<xsl:value-of
> select="$value/@id"/>]</xsl:if>
> ...
>
> I can call this template e.g. with the following syntax:
>
> <xsl:with-param name="value" select="."/>
>
> However what I cannot do is to pass another parameter like this:
>
> <xsl:param name="FIRSTNAME">rainer</xsl:param>
> <!-- apply the template -->
> <xsl:apply-templates select="field[@name='FIRSTNAME']">
> <xsl:with-param name="value" select="$FIRSTNAME"/>
> ...
>
> Xalan fails with the following exception message:
> "process failed:Can not convert #RTREEFRAG to a NodeList!"
>
> With the C-Version of calan this all works fine.
>
This looks to me like XalanJ is issuing the correct error message.
$FIRSTNAME is a result tree fragment since the xsl:param element in
which it is named has non-empty content. Your xsl:with-param element
binds the variable $value to that result tree fragment. Your xsl:if
element attempts to use the / operator on the result tree fragment which
is specifically prohibited in XSLT section 11.1. I would say that
XalanJ is doing the right thing and XalanC is in error here.
Gary