This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Using xsl:if to determine if a node is empty.


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]