Transform HTML Table to CALS Table

Posted on 2008-11-10
Last Modified: 2013-11-18

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???


Current Table in xml:


    <tr class="-R">

      <td class="-C" style="width:106.6pt;"  colspan="2">

              December 2003


      <td class="-C" style="width:185.35pt;">

          The Requisition delivered to the Exco




example output:


        <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*"/>



                                <entry namest="spycolgen1" nameend="spycolgen3">colspan</entry>




                                <entry morerows="1">rowspan</entry>













Open in new window

Question by:KenTan85
    1 Comment
    LVL 60

    Accepted Solution

    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)

    I hope this works for you

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
    Shoutout to Emily Plummer ( for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
    Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
    The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now