Re: I'm stupid (was: Re: Newbie help: "empty" elements)

Subject: Re: I'm stupid (was: Re: Newbie help: "empty" elements)
From: jany.quintard@xxxxxxx
Date: Tue, 14 Nov 2000 09:49:40 +0100 (MET)
Date: Mon, 13 Nov 2000 12:46:33 +0100 (MET)
From: jany.quintard@xxxxxxxxxxx
To: dssslist@xxxxxxxxxxxxxxxx
Subject: Re: I'm stupid (was: Re: Newbie help: "empty" elements)

On 11 Nov 2000, Norman Walsh wrote:
> / "Len Budney" <lbudney-lists-dsssl@xxxxxx> was heard to say:
> | That's still something I wonder; how can I identify elements which contain
> | data which is only whitespace. Any suggestions?

> If you know that it contains only #PCDATA, you can test to see if
> (data node) is just whitespace. Well, you'll have to loop over every
> character, I suppose. There are probably utility functions in the
> DocBook stylesheets to do some of this.

If you feel lazy, you can use the strip function in Norman's stylesheets 
(dblib.dsl) and test :
(if (equal? (string-length (strip (data (current-node)) " ")) 0)

Or you can customize it.

Jany.


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


Current Thread