xml-xalan-j-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From david_mars...@us.ibm.com
Subject Re: test attribute null evaluation doesn't work
Date Tue, 06 May 2003 18:22:33 GMT
>This code evaluates to true when StartTime is not set.
>   <xsl:when test="$StartTime">
>I want it to evaluate to false. It worked fine in xalan-1.

And the variable was set by....
<xsl:variable name="StartTime">
    <xsl:if test="...">
      <xsl:value-of select="substring-before($TimeValues, ';')"/>

This probably represents a required tightening-up between 1.x and 2.x.
As you've structured it, $StartTime contains a result tree fragment
(RTF), which you should read about in a good XSLT book. The RTF is
never totally empty.

Fortunately, your case has the easy workaround of just inverting the
<xsl:if test="...">
   <xsl:variable name="StartTime" select="..."/>
For more complicated situations, you could have a flag value that is
outside the range of valid times, or you could have a second boolean
variable $StartTimeSet to use in the xsl:when.
.................David Marston

View raw message