This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Using xsl:if to determine if a node is empty.
- To: "'xsl-list at mulberrytech dot com'" <xsl-list at mulberrytech dot com>
- Subject: RE: Using xsl:if to determine if a node is empty.
- From: Linus-Lin <LLin at OfficeDepot dot com>
- Date: Fri, 15 Sep 2000 14:04:56 -0400
- Reply-To: xsl-list at mulberrytech dot com
to test if VENDOR_ITEM_NUM is empty, this should work
<xsl:if test != ".">
-----Original Message-----
From: Roger Flory [mailto:rflory@mclaneco.com]
Sent: Friday, September 15, 2000 10:44 AM
To: 'XSL-List@mulberrytech.com'
Subject: Using xsl:if to determine if a node is empty.
I am fairly new to XML/XSL. In fact I am writing my first XSL for a
production environment. I am trying to determine if a node is empty so that
I can print a line or not. I have tried several different variations of
template matching and xsl:if statements and have not been able to get
anywhere.
Here is the latest thing that I have tried which seems to match evertime
through so the text is coming out even on empty tags.
<xsl:template match="VENDOR_ITEM_NUM">
<xsl:variable name="empty_tag"></xsl:variable>
<tr>
<td></td>
<td>
<font size="2">
<xsl:if test="$empty_tag != .">
<xsl:value-of select="concat('Vendor Item number:
',.)"/>
</xsl:if>
</font>
</td>
</tr>
</xsl:template>
Any help would be greatly appreciated.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list