Re: Contents present? Apparently simple but ...

Subject: Re: Contents present? Apparently simple but ...
From: Jany Quintard <quintard.j@xxxxxx>
Date: Tue, 14 Dec 1999 17:53:55 +0100 (CET)
On Tue, 14 Dec 1999, Matthias Clasen wrote:

> > 
> > 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.

data returns a string, so if there is no data, it should return an empty
string. But this is not equal to #f
I would try try something like :

 	(if (equal? (data (current-node)) "")
 	  ( -- branch 2 --)
 	  ( -- branch 1 --))

I am not sure that "" is a correct expression for empty string.

Jany.


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


Current Thread