Re: designing LOTs

Subject: Re: designing LOTs
From: Adam Di Carlo <adam@xxxxxxxxxxx>
Date: 22 Oct 1999 15:37:52 -0400
"David C. Mason" <dcm@xxxxxxxxxx> writes:

> Here is the situation: I have many tables in a book. Some tables
> contain certain data we'll call *foo* - other tables have *bar*
> data. I would like to put something like a ROLE attribute in each
> table: ROLE="foo" ROLE="bar".
> 
> Now I want my stylesheets to make an LOT for foo tables and an LOT for
> bar tables.

You should mention what DTD you're using.

> Does anyone have any good design tips for implementing this in DSSSL?
> I realize it is just an if - then but some help or tips would be
> appreciated.

I have done the following for a little custom XML DTD we use.  You're
going to have to extrapolate this for your data.  Especially see the
'select-elements' procedure, which you need to tune to just select the
proper tables (with the attribute setting you're looking for), and
then take that node list and squeeze it thru you LOT formatter
($participant-list$ in this example).

(mode participant-list-mode
  (element project.participant
    (let ((role (attribute-string (normalize "role"))))
      (make element gi: "LI"
	    (make element gi: "A"
		  attributes: (list
			       (list "NAME" (attribute-string
					     (normalize "id"))))
		  (process-children))
	    (if (string? role)
		(make sequence
		  (literal ", ")
		  (make element gi: "EM"
			(literal role)))
		(empty-sosofo))))))

(define ($participant-list$ nl)
  (make element gi: "UL"
	(with-mode participant-list-mode
	  (process-node-list nl))))

(element project.info
  (let* (personnel (select-elements (children (current-node))
				       (normalize
					"project.participant")))
	(has-personnel (not (node-list-empty? personnel))))
    (make sequence
      (make element gi: "H3"
	    (literal "Personnel:"))
      (make element gi: "P"
	    (if has-personnel
		($participant-list$ personnel)
		(empty-sosofo))))))
	    

-- 
.....Adam Di Carlo....adam@xxxxxxxxxxxxxxxx<URL:http://www.onShore.com/>


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


Current Thread