Re: If statement question

Subject: Re: If statement question
From: "Mitch C. Amiano" <amiamc@xxxxxxxxxxxxxxx>
Date: Tue, 27 Jul 1999 17:16:31 -0400
You need the "data" procedure. Depending upon your actual SGML, this might work:

(element ANYPETS
  (if (string=? (data (current-node)) "No" )
    (empty-sosofo)
    (literal (string-append "Joe owns a" (data (current-node)) ) )
  )
)

"Darrell W. Royter" wrote:
> 
> I have encountered a rather difficult question recently. The answer may be
> simple, but it's the question itself that is hard to phrase, so bear with
> me.
> 
> I have a DSSSL and I wish to format an element based upon the content of the
> element itself. If the content of the element is "No", I want an empty
> sosofo, but I'd like to output everything else.
> 
> An example would be if I had a list of information about a person and wanted
> to list any pets the person has. If in the SGML I had  <name>Joe</>
> <anypets>Dog</>
> 
> I would want to output something like "Joe owns a dog". But if Joe has no
> pets, I don't want it to say "Joe owns a No."
> 
> >From what I have read and seen, there is no way for Jade to look at the
> content of an element. It can look at attribute strings, but not what falls
> in between the tags. Am I wrong? What do I need to do to fix this?
> 
> I have tried to phrase this in several different ways. The end result is
> that either all or none of the element appear in my document.
> 
> Thanks,
> Darrell
> 
>  DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist

--                                                                          --
Mitch C. Amiano                                 Mitch.C.Amiano@xxxxxxxxxxxxxxx
Software Development Engineer        Advanced Design Process       Alcatel USA
Being imprecise doesn't mean you've made a good abstraction.


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


Current Thread