You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Lucian COZMA <lc...@iakt.rdsnet.ro> on 2001/08/24 15:07:03 UTC
need help. problems with an condition
I have a problem with an xsl:if in a .xsl file.
<xsl:if test="/page/querystring/KT_FormState/text()='Detail'">
<xsl:value-of select="page/querystring/KT_FormState"/>
</xsl:if>
the condition never evaluates true.
Help !
Thanx.
the xml file looks like this:
<page>
<querystring>
<value>
<xsp:expr>request.getQueryString()</xsp:expr>
</value>
<KT_FormState>
Detail
</KT_FormState>
<KT_recordId>
1
</KT_recordId>
</querystring>
</page>
Re: need help. problems with an condition
Posted by Jörg Heinicke <jh...@virbus.de>.
Hi Lucian,
this is a general XML/XSL-problem and you should ask such problems to such a
list.
Furthermore this is one of the classical problems: the text-node of
KT_FormState contains line breaks because of your XML-file. I suggest to
rewrite your XML without such line breaks in the text-nodes:
<KT_FormState>Detail</KT_FormState>
Another help would be to test for "contains(/page/.../text(),'Detail')", but
maybe it's not exact enough.
Hope this helps,
Joerg
Lucian COZMA wrote:
> I have a problem with an xsl:if in a .xsl file.
>
> <xsl:if test="/page/querystring/KT_FormState/text()='Detail'">
> <xsl:value-of select="page/querystring/KT_FormState"/>
> </xsl:if>
>
> the condition never evaluates true.
>
> Help !
>
> Thanx.
>
>
> the xml file looks like this:
>
> <page>
>
> <querystring>
> <value>
> <xsp:expr>request.getQueryString()</xsp:expr>
> </value>
> <KT_FormState>
> Detail
> </KT_FormState>
> <KT_recordId>
> 1
> </KT_recordId>
> </querystring>
> </page>
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>