This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Printing Null Values with XSLT
- To: "'xsl-list at mulberrytech dot com'" <xsl-list at mulberrytech dot com>
- Subject: RE: Printing Null Values with XSLT
- From: Kay Michael <Michael dot Kay at icl dot com>
- Date: Fri, 13 Oct 2000 18:06:10 +0100
- Reply-To: xsl-list at mulberrytech dot com
> Now, what I want to happen is to add some XSLT language that would
> be able to not print, say, a Default column if, and only if, there
> is no value associated it to it. If it does find it, then it prints
> it.
I would start by defining boolean variables, one for each column,
to determine whether the column is needed, e.g.
<xsl:variable name="include_description"
select="boolean(item/@description[.!=''])"/>
This will be true if at least one of the <item> elements has a "description"
attribute
whose value is other than "".
Then when printing the header and other rows, test this variable:
<xsl:if test="$include_description">
<td><xsl:value-of select="@description"/></td>
</xsl:if>
Mike Kay
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list