Re: Contents present? Apparently simple but ...

Subject: Re: Contents present? Apparently simple but ...
From: Matthias Clasen <clasen@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 14 Dec 1999 17:23:23 +0100
> 
> I'm trying to test for the existence of element content so that I can do
> conditional processing on an element.
> 
> I would have said 
> 
> 	(if (data (current-node)
> 	  ( -- branch 1 --)
> 	  ( -- branch 2 --))
> 
> would do what I want.  However, branch 1 always gets executed, whether the
> element is empty or not.
> 

> 
> I thought this was simple, but I seem to be missing something :-(
> 

If there is no data, (data ...) returns an empty string. But every object
except #f counts as a true value in DSSSL. 

-- 
Matthias Clasen, 
Tel. 0761/203-5606
Email: clasen@xxxxxxxxxxxxxxxxxxxxxxxxxx
Mathematisches Institut, Albert-Ludwigs-Universitaet Freiburg


 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist


Current Thread