Re: (dsssl) overlapping table cells

Subject: Re: (dsssl) overlapping table cells
From: "Paul Tyson" <paul@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 9 Feb 2002 15:32:46 -0800
----- Original Message -----
From: "SKV" <skvenkat@xxxxxxxxx>
To: <DSSSList@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Friday, February 08, 2002 11:36 PM
Subject: (dsssl) overlapping table cells

> Hi,
> I am wondering (for sometime now) how this Elsevier SGML "cspan"
> span) attribute can be implemented.
> Old archives in the biglist tells you to do this:
> (element c
>     (make table-cell
> n-columns-spanned: (string->number (attribute-string "cspan"))
>   ) )
> This doesn't work in this case since we have overlapping elements...
> <r><c cspan="2">Entry 1</c><c></c></r>
> <r><c>1.0</c><c>2.0</c></r>
> What we need is more like merge cells...

The easiest way is probably to suppress processing of cells following a
cell with a cspan attribute.

Something like this should work:
(element c
    (if ( preceding c has cspan > 1 )
        (make table-cell ...)))

You must make a procedure for "preceding c has cspan > 1" that is
general enough to deal with your data.  If you have a variable number of
columns, and any cell can span any number of columns, you could make a
procedure that takes a node-list argument (consisting of the preceding
cells), and returns #t or #f depending on whether a span is still in
effect at the current cell.

Another approach would be to handle cell processing at the row level,
using modes or (process-node-list).  Then you could select which cells
to process.  In this case the (element row) procedure wouldn't do

Hope this helps.


Paul Tyson, Principal Consultant                   Precision Documents
     "The art and science of document engineering."

> Thanks
> TnQ Books and Journals

 DSSSList info and archive:

Current Thread