xsl-list
[Top] [All Lists]

Omnimark vs. XSL (Saxon) Challenge

2004-03-16 07:06:35
Dear experts,

Recently I was quite unimpressed by the presentation of an Omnimark script 
requiring 32 seconds to make what seemed like a little change to a 2000 cells 
table. I said, this would be possible with XSL as well, and suddenly I found 
myself challenged.

After some hours I have a working solution but it is so slow... I hope I have 
missed something important with my method and now I am seeking assistance.

The task seemed simple at first:

HTML tables usually have width attributes for each cell. CALS and some other 
table models require all column widths to be specified at the top level, e.g. 
as an attribute of the table element. 

Input table:

<table>
  <tbody>
    <row>
      <entry colspan="2" rowspan="2" width="70%">I</entry>
      <entry colspan="2" width="30%">II</entry>
    </row>
    ...
  </tbody>
</table>

Desired output:

<table width="48mm 36mm 24mm 12mm">
  <tbody>
    <row>
      <entry colspan="2" rowspan="2">I</entry>
      <entry colspan="2">II</entry>
    </row>
    ...
  </tbody>
</table>

The main problem is the use of colspan and rowspan, which makes it hard for any 
cell to know to which column it belongs. One has to render the table from start 
to finish to learn that for each cell.

I read about Michael Kay's "Knight's Tour Stylesheet" and created a very 
recursive similar thing. I recursively loop through all rows, through all 
cells, within spanned cells through all rowspans and then through all colspans.

I would very much appreciate any comments and will gladly summarize.

Please find links to the stylesheet and sample files at 

http://cap-studio.de/test/challenge.html

Thanks a lot,

- Michael
-- 
________________________________________________________
Michael Müller-Hillebrand, cap studio, Erlangen, Germany
http://cap-studio.de/en/
Increase Knowledge Worker's Efficiency using
FrameMaker, XML/XSL, FrameScript, WebWorks Publisher,...

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



<Prev in Thread] Current Thread [Next in Thread>