This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Adding headers attributes to CALS tables for accessibility


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.

Here is a small complex table that uses the CALS model. So far, my
solutions that can determine the column for the middle cell and the bottom
left cell all fail when used with more complex tables (many columns wide,
with many spanned rows). It also gets more complex when the left column
contains header information, and @headers must reference both the top cell
and the left-hand cell.
<table>
<tgroup cols="3">
<thead>
  <row>
    <entry>id=a</entry>
    <entry>id=b</entry>
    <entry>id=c</entry>
  </row>
</thead>
<tbody>
  <row>
    <entry morerows="1">headers=a</entry>
    <entry>headers=b</entry>
    <entry>headers=c</entry>
  </row>
  <row>
    <entry morerows="1">headers=b</entry>
    <entry>headers=c</entry>
  </row>
  <row>
    <entry>headers=a</entry>
    <entry>headers=c</entry>
  </row>
</tbody>
</tgroup>
</table>

This is the desired XHTML output (the actual @id and matching @headers
would be created with generate-id; I've only placed them into the content
so it can be viewed in a browser):
<table>
<thead>
  <tr>
    <th id="a">id=a</th>
    <th id="b">id=b</th>
    <th id="c">id=c</th>
  </tr>
</thead>
<tbody>
  <tr>
    <td headers="a" rowspan="2">headers=a</td>
    <td headers="b">headers=b</td>
    <td headers="c">headers=c</td>
  </tr>
  <tr>
    <td headers="b" rowspan="2">headers=b</td>
    <td headers="c">headers=c</td>
  </tr>
  <tr>
    <td headers="a">headers=a</td>
    <td headers="c">headers=c</td>
  </tr>
</tbody>
</table>

For reference, here is the w3 description of the headers and id attributes
on table cells:
http://www.w3.org/TR/WCAG10-HTML-TECHS/#identifying-table-rows-columns

Any solutions using XSLT 2.0 would also be appreciated, although I will not
be able to make use of them until sometime in the future...

Thanks,
Robert



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]