don asked me to run some samples through xliffroundtrip tool grabbed the dita open toolkit samples...
TRANSCRIPT
Don asked me to run some samples through xliffRoundTrip tool
• Grabbed the DITA Open Toolkit samples (DITA-OT1.2.2_bin.zip) from
http://dita-ot.sourceforge.net
• Ran them through the xliffRoundTrip tool
http://sourceforge.net/projects/xliffroundtrip/
Started with one of Don’s samples
<!-- (C) Copyright IBM Corporation 2001, 2005. All Rights Reserved.
*--><!DOCTYPE concept PUBLIC "-//OASIS//DTD
DITA Concept//EN" "../../dtd/concept.dtd"><concept id="conceptconcept" xml:lang="en-us"><title>Garage Concepts</title><conbody><p>A well-stocked garage can be the
envy of the neighborhood.</p></conbody></concept>
Ran the xliffRoundTrip tool: XML to XLIFF step
Created a perfectly valid XLIFF File
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xmrk="http://www.xmarker.com" version="1.1" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.1 xliff-1.1.xsd">
<file original="concept" source-language="en" datatype="plaintext" xmrk:id="conceptconcept"><body><trans-unit xmrk:ancs="1" id="title-x-mch1-N10006" resname="title"><source xmrk:ancs="1">Garage Concepts</source><target>Garage Concepts</target></trans-unit><group xmrk:ancs="1" resname="conbody"><group resname="conbody" xmrk:ancs="1" id="throw1-N10008"><trans-unit xmrk:ancs="2" id="p-x-mch1-N10009" resname="p"><source xmrk:ancs="2">A well-stocked garage can be the envy of the neighborhood.</source><target>A well-stocked garage can be the envy of the neighborhood.</target></trans-unit></group></group></body></file></xliff>
Did a quick and dirty translation<xliff xmlns="urn:oasis:names:tc:xliff:document:1.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xmrk="http://www.xmarker.com" version="1.1" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.1 xliff-1.1.xsd">
<file original="concept" source-language="en" datatype="plaintext" xmrk:id="conceptconcept"><body><trans-unit xmrk:ancs="1" id="title-x-mch1-N10006" resname="title"><source xmrk:ancs="1">Garage Concepts</source><target>Garage-Konzepte</target></trans-unit><group xmrk:ancs="1" resname="conbody"><group resname="conbody" xmrk:ancs="1" id="throw1-N10008"><trans-unit xmrk:ancs="2" id="p-x-mch1-N10009" resname="p"><source xmrk:ancs="2">A well-stocked garage can be the envy of the neighborhood.</source><target>Eine gut-auf Lagere Garage kann der Neid der Nachbarschaft sein.</target></trans-unit></group></group></body></file></xliff>
Did the XLIFF to XML step
Got a translated DITA file
<?xml version="1.0" encoding="utf-8"?><!-- (C) Copyright IBM Corporation 2001, 2005. All
Rights Reserved. *--><concept id="conceptconcept"><title>Garage-Konzepte</title><conbody><p>Eine gut-auf Lagere Garage kann der Neid der
Nachbarschaft sein.</p></conbody></concept>
Problem: lots of DITA files can be tedious to process, 1 by 1
Created a little command-line application; goes like this:
• Started with xliffRoundTrip Tool’s XSLTs• Noted that the sample has a map file
(hierarchy.ditamap)• (being shamefully inexperienced with DITA) . . .
I made a naive assumption that many DITA documents have some kind of map file
• Modified the XSLT to read the mapfile, and convert each of the referenced files to XLIFF
You can try the sample application
Unzip the zip file; get this
Note: to output many-from-one, XSLT 2.0 was necessary. I included Saxon-B 8.7.1, which is officially hosted here:
http://saxon.sourceforge.net/#F8.7.1SA
Double click step1_D2X.bat• step1_D2X.bat interrogates the samples\
hierarchy.ditamap• Generates an XLIFF file (xliff_ized_DITA.xlf) which has
<file> elements for each file referenced in the hierarchy.ditamap
xliff_ized_DITA.xlf
Double click step2_pseudo-xlate.bat
For demonstration purposes, hit the XLIFF file with a little pseudo translation XSLT
• step2_pseudo-xlate.bat “translates” the <target> elements in the xliff_ized_DITA.xlf XLIFF file, to create p_xlated_xliff_ized_DITA.xlf
p_xlated_xliff_ized_DITA.xlf
Double click step3_X2D.bat• step3_X2D.bat transforms the
“translated” XLIFF file (p_xlated_xliff_ized_DITA.xlf) to translated DITA files
• It creates subdirectories for the translated files, and puts the DITA files in the appropriate subdirectory