transformin CALS tables

Subject: transformin CALS tables
From: Jany Quintard <quintard.j@xxxxxx>
Date: Mon, 27 Mar 2000 16:59:33 +0200 (CEST)
Hi all.

I have a problem of SGML to SGML transformation. The element to transform
are table (derived from cals tables).
The input SGML is badly generated and I want to correct this with a dsssl
stylesheet. My purpose is to merge the rows that have same class
attribute.
The use of class attribute is not mandatory, but it seeme a mean to
mark the rows that are actually parts of the same row.

Suppose I have a table part like this :
<tbody>
  <row class="01">
    <entry>1 of 01</entry>
    <entry>2 of 01</entry>
    <entry>3 of 01</entry>
  </row>

  <row class="01">
    <entry>following of 01-1</entry>
    <entry>following of 01-2</entry>
    <entry>following of 01-3</entry>
  </row>

  <row class="02">
    <entry>1 of 02</entry>
    <entry>2 of 02</entry>
    <entry>3 of 02</entry>
  </row>
</tbody>

I want to 

What I want is :
<tbody>
  <row class="01">
    <entry>1 of 01 following of 01-1</entry>
    <entry>2 of 01 following of 01-2</entry>
    <entry>3 of 01 following of 01-3</entry>
  </row>

  <row class="02">
    <entry>1 of 02</entry>
    <entry>2 of 02</entry>
    <entry>3 of 02</entry>
  </row>
</tbody>

I am trying to build a stylesheet to obtain this result. The problem
is that my code  seems awfully complicated (select-elements, loops and so
on) and I am not even sure that it will work. 

Does anyone have some guidelines to process this in a simple (and
efficient) way ?

TIA. Jany.


 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist


Current Thread