You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Eric SCHAEFFER <es...@posterconseil.com> on 2000/03/02 17:07:34 UTC

Re: Bug in XPath - Xalan J 0.19.2

Just try this :

file.xml :

<?xml version="1.0"?>
<?xml-stylesheet href="file1.xsl" type="text/xsl"?>
<page>
    <test>Hello</test>
</page>


file.xsl :

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">

<xsl:template match="page">
    <xsl:if test="test/text() = 'Hello'">
        <xsl:variable name="test-var"><xsl:value-of
select="test"/></xsl:variable>
    </xsl:if>

    <xsl:choose>
        <xsl:when test="$test-var">
            Test is defined : <xsl:value-of select="$test-var"/>
        </xsl:when>
        <xsl:otherwise>
            Test isn't defined
        </xsl:otherwise>
    </xsl:choose>
</xsl:template>

</xsl:stylesheet>


First time, it's Ok. But do it again, with another text value for
"/page/test"...


Eric.

_______________________________________

Eric SCHAEFFER
eschaeffer@posterconseil.com

POSTER CONSEIL
118 rue de Tocqueville
75017 PARIS
FRANCE
Tel. : 33-140541058
Fax : 33-140541059
_______________________________________

----------------------------------------------------------------------------
-----------------------------
 Come to the first official Apache Software Foundation Conference!
-----------------------------------
http://ApacheCon.Com ------------------------------------

----- Original Message -----
From: Scott Boag/CAM/Lotus <Sc...@lotus.com>
To: Eric SCHAEFFER <es...@posterconseil.com>
Cc: <xa...@xml.apache.org>
Sent: Tuesday, February 29, 2000 6:38 PM
Subject: Re: Bug in XPath - Xalan J 0.19.2


>
> Eric, I think this is fixed in the latest, but if I could have a small
> example stylesheet that reproduces the bug, we can be for sure.
>
> -scott
>
>
>
>
>
>                     "Eric SCHAEFFER"
>                     <eschaeffer@posterco        To:
<xa...@xml.apache.org>
>                     nseil.com>                  cc:     (bcc: Scott
Boag/CAM/Lotus)
>                                                 Subject:     Bug in
XPath - Xalan J 0.19.2
>                     02/29/00 06:08 AM
>                     Please respond to
>                     xalan-dev
>
>
>
>
>
>
> xsl:if / xsl:choose
> in the test clause :
> If I test existance of a global variable, and if it doesn't exist, I've
got
> a NullPointerException (at org.apache.xalan.xslt.ElemChoose.execute, or at
> the ElemIf.execute).
> If the variable exists, it's Ok.
>
> I've got several stylesheet inclusion, and in the principal (the first one
> that includes the others), I sometime declare a variable at the top of the
> stylesheet. In the included ones, I want to know if the variable exists.
>
> Maybe the bug is corrected in the new release ...
>
> Eric.
>
> _______________________________________
>
> Eric SCHAEFFER
> eschaeffer@posterconseil.com
>
> POSTER CONSEIL
> 118 rue de Tocqueville
> 75017 PARIS
> FRANCE
> Tel. : 33-140541058
> Fax : 33-140541059
> _______________________________________
>
> --------------------------------------------------------------------------
--
>
> -----------------------------
>  Come to the first official Apache Software Foundation Conference!
> -----------------------------------
> http://ApacheCon.Com ------------------------------------
>
>
>
>
>
>