xml-xalan-j-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krobe...@mmm.com
Subject test attribute null evaluation doesn't work
Date Tue, 06 May 2003 18:04:45 GMT
I'm sorry to bother you all over this; but I've tried several things and
can't get this to work in xalan-j 2.5.0. I am also fairly new to xslt.

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.

Here is a simple test stylesheet.

<?xml version="1.0"?>

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

  <xsl:output method="xml" version="1.0" encoding="ISO-8859-1"/>
  <xsl:strip-space elements="*"/>

  <xsl:param name="TimeOption">AllTimes</xsl:param>
  <xsl:param name="TimeValues"/>

  <!-- variables used for setting up search criteria -->
  <xsl:variable name="StartTime">
    <xsl:if test="$TimeOption='SlidingTimes' or $TimeOption
      <xsl:value-of select="substring-before($TimeValues, ';')"/>
  <xsl:variable name="EndTime">
    <xsl:if test="$TimeOption='SlidingTimes' or $TimeOption
      <xsl:value-of select="substring-after($TimeValues, ';')"/>

  <!-- main template -->
  <xsl:template match="/">

    <xsl:message>**************$TimeOption****<xsl:value-of select
    <xsl:message>**************$StartTime****<xsl:value-of select


     <xsl:when test="$StartTime">
            <!-- Start Time -->
              <attribute ncid="4" />
                        <xsl:value-of select="$StartTime" />

        <!-- End Time -->
          <attribute ncid="5" />
                        <xsl:value-of select="$EndTime" />




Any assistance will be greatly appreciated.


View raw message