Contents present? Apparently simple but ...

Subject: Contents present? Apparently simple but ...
From: MARK.WROTH@xxxxxxxxxxx (Wroth, Mark)
Date: Tue, 14 Dec 1999 07:42:37 -0800
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.

Background: the element is a citation reference, and occurs in one of three
forms:

	<CITE id="Johnston"></CITE>
      <CITE id="Johnston">p. 27</CITE>
      <CITE>Johnston (1978), p. 27</CITE>

The idea is to construct the reference string, in this example "Johnston
(1978)", from the other end of the link if an ID is given.  If there is data
(presumably a page number or other relevant information), I want to insert a
separator string and then the data contents.  But if there is no ID given, I
just want the data contents (i.e. without prepending the separator string).

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


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


Current Thread