Table import in DITA format?.

Post here questions and problems related to editing and publishing DITA content.
Posts: 8092
Joined: Fri Jul 09, 2004 5:18 pm

Re: Table import in DITA format?.

Post by Radu »


We have an add-on for Oxygen which can convert Excel to DITA tables:

We plan to improve it to also support import from CSV files but we have not yet managed to find the time for this. If you can export all your files to Excel then you could use our add-on.
Otherwise, indeed a custom XSLT stylesheet could be created to convert between the exported XML format and DITA. The XSLT would probably need to look something like:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl=""
    <xsl:output indent="yes"/>
    <xsl:template match="node() | @*">
            <xsl:apply-templates select="node() | @*"/>
    <xsl:template match="row/*">
    <xsl:template match="row">
    <xsl:template match="root">
               <xsl:attribute name="cols">
                   <xsl:value-of select="(//row)[1]/count(*)"/>
                    <xsl:apply-templates select="(//row)[1]"/>
                    <xsl:apply-templates select="(//row)[not(position() = 1)]"/>
Another more hidden workaround would be to open the exported XML document and switch to the "Grid" editing mode, expand in the Grid mode until you see the table-like representation of the rows, from that table select all cells but without selecting the row numbers, copy and then paste in a DITA topic opened in the Author visual mode. Oxygen should convert the table to a DITA table but it will not properly mark the first row as a header row. You can do that later using the "Table Properties" action.

Radu Coravu
<oXygen/> XML Editor