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

KenTan85Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gertone (Geert Bormans)Information ArchitectCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.