Table import in DITA format?.
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Table import in DITA format?.
Hi,
We have an add-on for Oxygen which can convert Excel to DITA tables:
https://github.com/oxygenxml/oxygen-resources-converter
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:
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.
Regards,
Radu
We have an add-on for Oxygen which can convert Excel to DITA tables:
https://github.com/oxygenxml/oxygen-resources-converter
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="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="xs"
version="2.0">
<xsl:output indent="yes"/>
<xsl:template match="node() | @*">
<xsl:copy>
<xsl:apply-templates select="node() | @*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="row/*">
<entry>
<xsl:apply-templates/>åß
</entry>
</xsl:template>
<xsl:template match="row">
<row>
<xsl:apply-templates/>
</row>
</xsl:template>
<xsl:template match="root">
<table>
<tgroup>
<xsl:attribute name="cols">
<xsl:value-of select="(//row)[1]/count(*)"/>
</xsl:attribute>
<thead>
<xsl:apply-templates select="(//row)[1]"/>
</thead>
<tbody>
<xsl:apply-templates select="(//row)[not(position() = 1)]"/>
</tbody>
</tgroup>
</table>
</xsl:template>
</xsl:stylesheet>
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “DITA (Editing and Publishing DITA Content)”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service