You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by kr...@mmm.com on 2003/05/16 22:14:47 UTC
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.
Re: Archives of this alias
Posted by Joseph Kesselman <ke...@us.ibm.com>.
http://marc.theaimsgroup.com/?l=xalan-j-users
(For more info on Apache mailing lists, see
http://xml.apache.org/mail.html)
______________________________________
Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more.
"The world changed profoundly and unpredictably the day Tim Berners Lee
got bitten by a radioactive spider." -- Sandy Tyra, in r.m.filk
Archives of this alias
Posted by Sanyogita Kalavade <Sa...@Sun.COM>.
Does anyone know where I could get the archives of this alias.
Thanks
Sanyogita
Re: How to check for a null RTF?
Posted by da...@us.ibm.com.
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.