• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 890
  • Last Modified:

Transform HTML Table to CALS Table

Hi,

currently i'm working on a project, whereby i convert data in microsoft word 2007 to xml file.
the problem now i'm having is that, the table is in HTML structure in the xml file. I need to transform the HTML table in the xml file to CALS table..

does anyone have any idea???

Thanks...



Current Table in xml:
<table>
    <tr class="-R">
      <td class="-C" style="width:106.6pt;"  colspan="2">
              December 2003
      </td>
      <td class="-C" style="width:185.35pt;">
          The Requisition delivered to the Exco
      </td>
    </tr>
</table>
 
example output:
<table>
        <tgroup cols="4">
                <colspec colnum="1" colname="spycolgen1" colwidth="1.0*"/>
                <colspec colnum="2" colname="spycolgen2" colwidth="1.0*"/>
                <colspec colnum="3" colname="spycolgen3" colwidth="1.0*"/>
                <colspec colnum="4" colname="spycolgen4" colwidth="1.0*"/>
                <tbody>
                        <row>
                                <entry namest="spycolgen1" nameend="spycolgen3">colspan</entry>
                                <entry>2</entry>
                        </row>
                        <row>
                                <entry morerows="1">rowspan</entry>
                                <entry>4</entry>
                                <entry>5</entry>
                                <entry>6</entry>
                        </row>
                        <row>
                                <entry>7</entry>
                                <entry>8</entry>
                                <entry>9</entry>
                        </row>
                </tbody>
        </tgroup>
</table>

Open in new window

0
KenTan85
Asked:
KenTan85
1 Solution
 
Geert BormansCommented:
General XHTML to CALS table model is a tricky beast.

If you can use XSLT2, here is a possible solution
(I remembered this post on the XSL list at mulberry tech)
http://markmail.org/search/?q=html-to-cals#query:html-to-cals+page:1+mid:3p5tpiaprpmdmy7t+state:results

I hope this works for you
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now