DITA Roundtrip with XLIFF+ITS 2.0

From Ocelot
Jump to: navigation, search

This page describes my first experiments with the DITA-XLIFF Roundtrip for OT and Ocelot. My experiment was to convert from DITA to XLIFF, use Ocelot to add ITS 2.0 metadata and then convert back to DITA. Eventually I would like to see if I can transfer some of the metadata to the DITA documents but I currently do not know enough about DITA to do that.

My thanks to Felix Sasaki and Patrick Tinley for their help with this.

  1. Download and install version 1.6 of the DITA Open Toolkit. I chose this version as it is the version which the DITA-XLIFF Roundtrip for OT supports.
  2. Download and install the DITA-XLIFF Roundtrip for OT.
  3. Copy its20.xsd and its20-types.xsd to the DITA-OT1.6\plugins\ditafromxliff\in\ folder. NOTE: do not use the schema files referred to in Appendix D of the Recommendation document.
  4. Edit DITA-OT1.6\plugins\ditafromxliff\xsl\x2d.xsl. Add the following line just below the first <xsl:template match="node()|@*"> definition:
    <xsl:template match="xlf:tool"/>
  5. Edit the translated XML file to include a declaration for the ITS schema in the XLIFF root element:
    <xliff version="1.2"... its20.xsd xmlns:its="http://www.w3.org/2005/11/its">
  6. Follow the "DITA to XLIFF sample" and "XLIFF to DITA sample" sections of the DITA-XLIFF_readme.txt file.

So the workflow I was experimenting with was:

  1. Convert DITA to XLIFF
  2. Edit with Ocelot and add metadata
  3. Convert from XLIFF to DITA

You loose the ITS 2.0 metadata in this workflow but as I point out, this is because I do not know enough about DITA to transfer the metadata. Also, within VistaTEC we have other ways of harvesting the metadata so it's not a critical issue for us right now.