Table import in DITA format
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 485
- Joined: Thu Jan 23, 2014 2:29 pm
- Location: Hamburg
- Contact:
Table import in DITA format
Post by Frank Ralf »
We want to import text tables like the following into DITA:
The File > Import > Text File function works fine, but gives us the following:
Whereas in DITA we would prefer something like this:
Can this be configured using some settings or do we have to use a XSLT transformation?
TIA
Frank
Code: Select all
Type | Value | Description
Lead | Low | Starting point for alchemists.
Gold | High | The alchemist’s goal.
Code: Select all
<root>
<row>
<Type>Lead</Type>
<Value>Low</Value>
<Description>Starting point for alchemists.</Description>
</row>
<row>
<Type>Gold</Type>
<Value>High</Value>
<Description>The alchemist’s goal.</Description>
</row>
</root>
Code: Select all
<table>
<row>
<entry colname="Type">Lead</entry>
<entry colname="Value">Low</entry>
<entry colname="Description">Starting point for alchemists.</entry>
</row>
<row>
<entry colname="Type">Gold</entry>
<entry colname="Value">High</entry>
<entry colname="Description">The alchemist’s goal.</entry>
</row>
</table>
TIA
Frank
Frank Ralf
parson AG
www.parson-europe.com
parson AG
www.parson-europe.com
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Table import in DITA format
Post by sorin_ristache »
Hello,
All the possible configuration options are available in the Import dialog box. As you can see there you can select between child element in the <row> element and attribute of the <row> element, but you can't add an attribute to the child element of <row>. You will need a simple XSLT transformation.
Regards,
Sorin
All the possible configuration options are available in the Import dialog box. As you can see there you can select between child element in the <row> element and attribute of the <row> element, but you can't add an attribute to the child element of <row>. You will need a simple XSLT transformation.
Regards,
Sorin
-
- Posts: 485
- Joined: Thu Jan 23, 2014 2:29 pm
- Location: Hamburg
- Contact:
Re: Table import in DITA format
Post by Frank Ralf »
Thanks for the quick reply. That's what I suspected.
Frank Ralf
parson AG
www.parson-europe.com
parson AG
www.parson-europe.com
-
- Posts: 485
- Joined: Thu Jan 23, 2014 2:29 pm
- Location: Hamburg
- Contact:
Re: Table import in DITA format
Post by Frank Ralf »
JFTR here's the XSLT I'm using:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="root">
<table>
<xsl:apply-templates/>
</table>
</xsl:template>
<xsl:template match="row">
<row>
<xsl:apply-templates/>
</row>
</xsl:template>
<xsl:template match="*">
<entry>
<xsl:attribute name="colname">
<xsl:value-of select="local-name()"/>
</xsl:attribute>
<xsl:value-of select="."/>
</entry>
</xsl:template>
</xsl:stylesheet>
Frank Ralf
parson AG
www.parson-europe.com
parson AG
www.parson-europe.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)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ 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