How to test empty strings
Posted: Wed Mar 26, 2008 9:17 pm
hi,
I am trying to print a message when a string is empty.
This works well if the nonempty_string has a value. In other words, for an empty string I am not able to print "None".
I am trying to print a message when a string is empty.
Code: Select all
<xsl:variable name="nonempty_string" select="n2:Protocol/n2:FundingSource/n2:FundingSourceName"/>
<xsl:variable name="empty_string" />
<xsl:choose>
<xsl:when test="$nonempty_string != $empty_string" >
<xsl:apply-templates />
</xsl:when>
<xsl:otherwise >
<fo:inline>None</fo:inline>
</xsl:otherwise>
</xsl:choose>