Re: [xsl] cals table tgroup/colspec/@align attributes written to entry/@align

Subject: Re: [xsl] cals table tgroup/colspec/@align attributes written to entry/@align
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Mon, 21 May 2007 13:31:47 +0100
On 5/21/07, Frank Marent <frank.marent@xxxxxxxxxxx> wrote:
hello

i wonder if there is an existing xslt solution for this. i couldn't
find one:

in cals tables column alignments are set as tgroup/colspec/@align
attributes. we need an xslt that inherits entry/@align attributes
from the appropriate tgroup/colspec/@align attributes, so the values
of the tgroup/colspec/@align attributes are written correctly to the
appropriate entry/@align attributes.

since cals tables can be very mean concernings cell spans this is not
a trivial task. like this six column table below shows. in this table
the three cells in the fifth row (a5, d5 and f5) have to be
recognized correctly as first, forth and sixth column cell and cell
d5 should be centered since column d is centered.

Here's an XSLT 1.0 solution I wrote a long time ago:


http://www.dpawson.co.uk/xsl/sect2/N7450.html#d10871e676

I'm sure I had an XSLT 2.0 version somewhere but I can't find it
now... I can't vouch for the quality of 1.0 solution, I just remember
CALS being a pain - the optional naming of cells which means you would
have to normalize the table first to work out exactly which colgroup
the cell belonged to, something like that anyway... the synapses have
long since disconnected and moved to happier parts.

Alternatively you can look at docbooks table.xsl which is for the
OASIS table model, which is very similar but doesn't have the nasty
parts of CALS (afaik).

Best of luck,
andrew.

Current Thread