Re: [xsl] Adding headers attributes to CALS tables for accessibility

Subject: Re: [xsl] Adding headers attributes to CALS tables for accessibility
From: "Christopher R. Maden" <crism@xxxxxxxxx>
Date: Fri, 23 Aug 2002 03:25:22 -0700
Hash: SHA1

At 12:16 21/8/02, Robert D Anderson wrote:
>I have a CALS-model table that is being converted into XHTML using XSL 1.0.
>I need to make sure that my tables are accessible for screen readers; this
>means that I need to add @id to all of the header cells and @headers to all
>content cells. For any given entry, I need to know which column that entry
>is in, so I know which header cell to associate it with. This is simple for
>tables that do not span rows/columns; it is more complex for spanned
>columns, but still not too difficult (because spanned columns require you
>to specify which column starts the entry and which column ends it).
>However, is there a reliable way to determine my position in a table when
>entries can span rows? I've tried several recursive algorithms, but have
>not found one that works in all cases.

This is a rather hairy problem.  One thing that would drastically ease it 
is if you consistently used the CALS colnum or colname attributes; then it 
would be a simple matter of finding the ID of the header cell with the same 
colname.  Horizontal spans would muddle this, too, of course, but my point 
is that if your data satisfies known constraints you can make assumptions 
in the processing.

For arbitrary CALS tables as you present them, this is nasty 
indeed.  However, I'm not sure that your example table is valid.  You may 
find the entry.colnum template in Norm Walsh's DocBook XSLT stylesheets to 
be useful; but looking that over, I'm reminded that the column number of an 
entry is one more than the previous entry, or one if it's the first in the 
row, unless a colnum or colname is given.  See <URL: >; it's not crystalline, but I 
think that your sample CALS table has overlapping cells.  (It's been a long 
time since I wrestled with CALS tables.)

- -- 
Christopher R. Maden, Principal Consultant, crism consulting
DTDs/schemas - conversion - ebooks - publishing - Web - B2B - training
<URL: >
PGP Fingerprint: BBA6 4085 DED0 E176 D6D4  5DFC AC52 F825 AFEC 58DA
Version: PGP Personal Privacy 6.5.8


 XSL-List info and archive:

Current Thread