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
- Subject: Re: Using xsl:if to determine if a node is empty.
- From: Gary L Peskin <garyp at firstech dot com>
- Date: Fri, 15 Sep 2000 14:05:35 -0700
- Organization: The Firstech Corporation
- References: <3.0.1.32.20001015191940.00a62d40@localhost>
- Reply-To: xsl-list at mulberrytech dot com
Jeni Tennison wrote:
> If you want to use a variable to hold an empty string to test against, you
> should probably define it as:
>
> <xsl:variable name="empty_string" select="''" />
>
> as this creates an empty *string* rather than an empty 'result tree fragment'.
Jeni --
I'm not sure if you or others realize this since I just learned it
myself (:)) but
<xsl:variable name="empty_string"/>
is equivalent to your expression (XSLT Spec 11.2). However, I don't
think that this is working in XalanJ at the moment so your form is
definitely safer until I get in the patch for that bug.
Gary
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list