Re: Testing on attribute values in nested lists

Subject: Re: Testing on attribute values in nested lists
From: Norman Walsh <norm@xxxxxxxxxxxxx>
Date: Fri, 23 Jan 1998 07:50:17 -0500
> The SGML instance looks like this,
> 
> <list type="letter">
> <listitem><text>.......</text></listitem>
> <listitem><text>.......</text></listitem>
>       <sub.list type="letter">
>       <listitem><text>.......</text></listitem>
>       <listitem><text>.......</text></listitem>
>       </sub.list>
> </list>
> 
> I would like to present the list in the following way,
> 
> A. ITEM1
> B. ITEM2
>     B.A ITEM1
>     B.B ITEM2
>     B.C ITEM 3
> 
> The problem is that I have not found any way to test which attribute value
> that is set on the list element from the sub.list-listitem location or
> store the list-listitem literal and place it in front of the
> sublist-listitem. I have searched the DSSSL archive but have not found any
> answer.

There's a couple of ways to do this, here's one:

(element LISTITEM
  (let* ((p-gi (gi (parent (current-node))))
	 (gp-gi (gi (parent (parent (current-node)))))
	 (sublist-type (if (equal? p-gi "SUB.LIST")
	                   (attribute-string "TYPE" (parent (current-node)))
	                   ""))
	 (list-type  (if (equal? p-gi "LIST")
	                 (attribute-string "TYPE" (parent (current-node)))
                         (if (equal? gp-gi "LIST")
		             (attribute-string "TYPE" (parent (parent (current-node))))
	                     ""))))
  ...

Now you can test sublist-type and list-type in the body. Note: I haven't
run this, so check those parens; the proper case of SUB.LIST and LIST and TYPE
depends on your sgml declaration; there's not much error checking here.
You could also do it by making more specific element rules:

(element (LIST LISTITEM SUB.LIST LISTITEM)
  ...)

etc.

Does that help?

> Another question I have is if someone solved the trick  to collect the
> total number of pages and present the total number on the first page, e.g.
> Page 1 (23).

I don't think you can do this with any of the existing Jade backends.
The coupling between the FOT and the printed page is too loose.

--norm


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


Current Thread
  • Testing on attribute values in nested lists
    • Tomas Eriksson - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id FAA24469Fri, 23 Jan 1998 05:50:44 -0500 (EST)
      • Norman Walsh - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id HAA25518Fri, 23 Jan 1998 07:50:29 -0500 (EST) <=
        • Tomas Eriksson - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id IAA26199Fri, 23 Jan 1998 08:26:06 -0500 (EST)
        • Matthias Clasen - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id IAA26710Fri, 23 Jan 1998 08:39:35 -0500 (EST)