Subject: RE: CASE problems (in The DSSSList Digest V3 #81) From: MARK.WROTH@xxxxxxxxxxx (Wroth, Mark) Date: Wed, 23 Jun 1999 14:51:37 -0700 |
Tony Graham replied to my question about case problems: >At 23 Jun 1999 08:09 -0700, Wroth, Mark wrote: > > I'm attempting to write a DSSSL stylesheet, to be processed with Jade, which > > takes a series of items and prints them as three separate sequences, > > depending on the value of an attribute on the <item>. So if I have: > > > > <item id="1" dec="rtn">....</item> > > <item id="2" dec="reg">....</item> > > <item id="3" dec="reg">....</item> > > <item id="4" dec="rtn">....</item> > > <item id="5" dec="pend">....</item> > >Why don't you use: > >(select-elements (children (current-node)) '(item (dec rtn))) > >You may need to quote "dec", etc. > >With the DSSSL2 extensions in Jade, you can also do: > >(element (item attributes: (dec rtn)) > ...) > >These don't address your case question, I know, but they may make your >code simpler. I'll take simpler: I used case because I didn't know of a better way to handle the problem Avi Kitivity then chimed in with >Date: Wed, 23 Jun 1999 19:44:23 +0200 >From: Avi Kivity <Avi@xxxxxxxxxxxxx> >Subject: RE: CASE problem > >On Wednesday, June 23, 1999 18:09, MARK.WROTH@xxxxxxxxxxx >[SMTP:MARK.WROTH@xxxxxxxxxxx] wrote: >> The core statement is a case, basically >> >> (case (attribute-string "DEC") >> (("reg") (code to print the item)) >> (("rtn") (empty-sosofo)) >> (("pend")(empty-sosofo)) >> ((#f) (debugging code)) >> ) >> >> The symptom is that the #f clause *always* executes, regardless of >> the value >> of the attribute. Part of the debugging code prints the value of >> the >> attribute, and it's behaving as expected (i.e. I get "rtn" etc on >> the items >> I expect to). >> >Do you get "rtn" or "RTN"? I always get attribute values uppercased. I get "rtn" (without the quotes). Thinking that this might be the problem, one of the things I did to try to fix it was to uppercase the string in the case statement (i.e. use (("RTN")... instead of (("rtn")... ); it did not change the behavior of the system. DSSSList info and archive: http://www.mulberrytech.com/dsssl/dssslist
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
FYI: Harry Thompson's page, Iain Lowe | Thread | RE: CASE problems (in The DSSSList , Avi Kivity |
RE: Background on DSSSL, Tony Graham | Date | Re: HR element, Nik Clayton |
Month |