xml-xalan-j-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From david_n_bert...@us.ibm.com
Subject Re: How to check for a null RTF?
Date Fri, 16 May 2003 20:43:12 GMT




There's really no such thing as "null" in XSLT.  Do you mean you want to
know if it's empty?  If so, you can check the string value:

   not(string($DefaultFilter)) or $DefaultFilter=$NCID_Active_Meds_In

Dave



                                                                                         
                                               
                      kroberts@mmm.com                                                   
                                               
                                               To:      xalan-j-users@xml.apache.org     
                                               
                      05/16/2003 01:14         cc:      (bcc: David N Bertoni/Cambridge/IBM)
                                            
                      PM                       Subject: How to check for a null RTF?     
                                               
                                                                                         
                                               



I'm having a problem with some old xalan-1 code. A value is conditionally
assigned to the DefaultFilter parameter. $OSHProfile/filter/default does
not exist in the stylesheet parameter $OSHProfile. The not($DefaultFilter)
test always evaluates to false. This is because an RTF is never really
null, as I understand it.

It isn't clear to me how to rewrite this logic so it will work in xalan
2.5.0. I thought about using a boolean; but I have to be able to test
$OSHProfile/filter/default for a null value to assign the boolean variable.

Is there a way to reliably test an RTF for null?
Is there some other workaround that I am not seeing?

Thanks...



          <xsl:call-template name="SummaryTitles">
            <xsl:with-param name="Category">Medications</xsl:with-param>
            <xsl:with-param name="Title">Meds</xsl:with-param>
            <xsl:with-param name="Reply">medications.xsl</xsl:with-param>
            <xsl:with-param name="Icon">meds.gif</xsl:with-param>
            <xsl:with-param name="DefaultFilter">
              <xsl:choose>
                <xsl:when test="$EncSummary='YES'"><xsl:value-of select
="$EncFilter"/></xsl:when>
                <xsl:otherwise>
                  <xsl:value-of select="$OSHProfile/filter/default"/>
                </xsl:otherwise>
               </xsl:choose>
              </xsl:with-param>
          </xsl:call-template>

.....

                  <input type="radio" name="Sumpat" value="
{$NCID_Active_Meds_In}" onClick="javascript:SumFilterOption()">
                  <xsl:if test="not($DefaultFilter) or $DefaultFilter
=$NCID_Active_Meds_In">
                        <xsl:attribute name="checked">true</xsl:attribute>
                  </xsl:if>
                </input>Inpt.




Mime
View raw message