CASE problem

Subject: CASE problem
From: MARK.WROTH@xxxxxxxxxxx (Wroth, Mark)
Date: Wed, 23 Jun 1999 08:09:22 -0700
I suspect that the root of this is something really simple, but I've been
beating my head against this problem for too many hours now, so I'll ask
anyway.

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>

it prints as

-----------------------------------
Registrations:

	{text for item id=2}

	{text for item id=3}

Returns:

	{text for item id=1}

	{text for item id=4}

Pends:

	{text for item id=5}
----------------------------------

I've attempted to implement this as three calls to process-children wrapped
in appropriate modes to select the ones I'm interested in at the time.  My
problem comes when I attempt to write the rules for the <item>s themselves.
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).

I've done this before without any problems; the only variable I can identify
is that in this case the document itself is XML rather than a more generic
SGML.  I've tried a variety of things with the case of the strings (which is
why "DECISION" is in upper case -- despite the fact that it is declared and
used in lower case, using it in the case expression in lower case fails
silently [in the sense that none of the rules fire, causing me to infer that
Jade doesn't think the attribute exists]).

Comments? Suggestions?  I can post/mail the whole code if needed, but it's
rather long.

Thanks,

Mark


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


Current Thread
  • CASE problem
    • Wroth, Mark - Wed, 23 Jun 1999 11:10:34 -0400 (EDT) <=
      • <Possible follow-ups>
      • Avi Kivity - Wed, 23 Jun 1999 12:47:01 -0400 (EDT)