{"id":695,"date":"2014-03-25T12:52:21","date_gmt":"2014-03-25T11:52:21","guid":{"rendered":"http:\/\/blog.defrent.de\/?p=140"},"modified":"2021-07-01T13:36:47","modified_gmt":"2021-07-01T11:36:47","slug":"preparing-half-translated-bilingual-xml-for-trados-studio-with-xslt","status":"publish","type":"post","link":"https:\/\/www.defrent.de\/fr\/2014\/03\/preparing-half-translated-bilingual-xml-for-trados-studio-with-xslt\/","title":{"rendered":"Preparing half-translated bilingual XML for Trados Studio &#8211; with XSLT"},"content":{"rendered":"<div class=\"shariff shariff-align-left shariff-widget-align-left\" style=\"display:none\"><ul class=\"shariff-buttons theme-round orientation-horizontal buttonsize-small\"><li class=\"shariff-button mastodon\" style=\"background-color:#ccc\"><a href=\"https:\/\/s2f.kytta.dev\/?text=Preparing%20half-translated%20bilingual%20XML%20for%20Trados%20Studio%20%E2%80%93%20with%20XSLT https%3A%2F%2Fwww.defrent.de%2Ffr%2F2014%2F03%2Fpreparing-half-translated-bilingual-xml-for-trados-studio-with-xslt%2F via @defrentck@hessen.social\" title=\"Envoyer par Mastodon\" aria-label=\"Envoyer par Mastodon\" role=\"button\" rel=\"noopener nofollow\" class=\"shariff-link\" style=\"; background-color:#79b428; color:#fff\" target=\"_blank\"><span class=\"shariff-icon\" style=\"\"><svg width=\"75\" height=\"79\" viewBox=\"0 0 75 79\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M37.813-.025C32.462-.058 27.114.13 21.79.598c-8.544.621-17.214 5.58-20.203 13.931C-1.12 23.318.408 32.622.465 41.65c.375 7.316.943 14.78 3.392 21.73 4.365 9.465 14.781 14.537 24.782 15.385 7.64.698 15.761-.213 22.517-4.026a54.1 54.1 0 0 0 .01-6.232c-6.855 1.316-14.101 2.609-21.049 1.074-3.883-.88-6.876-4.237-7.25-8.215-1.53-3.988 3.78-.43 5.584-.883 9.048 1.224 18.282.776 27.303-.462 7.044-.837 14.26-4.788 16.65-11.833 2.263-6.135 1.215-12.79 1.698-19.177.06-3.84.09-7.692-.262-11.52C72.596 7.844 63.223.981 53.834.684a219.453 219.453 0 0 0-16.022-.71zm11.294 12.882c5.5-.067 10.801 4.143 11.67 9.653.338 1.48.471 3 .471 4.515v21.088h-8.357c-.07-7.588.153-15.182-.131-22.765-.587-4.368-7.04-5.747-9.672-2.397-2.422 3.04-1.47 7.155-1.67 10.735v6.392h-8.307c-.146-4.996.359-10.045-.404-15.002-1.108-4.218-7.809-5.565-10.094-1.666-1.685 3.046-.712 6.634-.976 9.936v14.767h-8.354c.109-8.165-.238-16.344.215-24.5.674-5.346 5.095-10.389 10.676-10.627 4.902-.739 10.103 2.038 12.053 6.631.375 1.435 1.76 1.932 1.994.084 1.844-3.704 5.501-6.739 9.785-6.771.367-.044.735-.068 1.101-.073z\"\/><defs><linearGradient id=\"paint0_linear_549_34\" x1=\"37.0692\" y1=\"0\" x2=\"37.0692\" y2=\"79\" gradientUnits=\"userSpaceOnUse\"><stop stop-color=\"#6364FF\"\/><stop offset=\"1\" stop-color=\"#563ACC\"\/><\/linearGradient><\/defs><\/svg><\/span><\/a><\/li><li class=\"shariff-button linkedin\" style=\"background-color:#ccc\"><a href=\"https:\/\/www.linkedin.com\/sharing\/share-offsite\/?url=https%3A%2F%2Fwww.defrent.de%2Ffr%2F2014%2F03%2Fpreparing-half-translated-bilingual-xml-for-trados-studio-with-xslt%2F\" title=\"Envoyer par LinkedIn\" aria-label=\"Envoyer par LinkedIn\" role=\"button\" rel=\"noopener nofollow\" class=\"shariff-link\" style=\"; background-color:#79b428; color:#fff\" target=\"_blank\"><span class=\"shariff-icon\" style=\"\"><svg width=\"32px\" height=\"20px\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 27 32\"><path fill=\"#0077b5\" d=\"M6.2 11.2v17.7h-5.9v-17.7h5.9zM6.6 5.7q0 1.3-0.9 2.2t-2.4 0.9h0q-1.5 0-2.4-0.9t-0.9-2.2 0.9-2.2 2.4-0.9 2.4 0.9 0.9 2.2zM27.4 18.7v10.1h-5.9v-9.5q0-1.9-0.7-2.9t-2.3-1.1q-1.1 0-1.9 0.6t-1.2 1.5q-0.2 0.5-0.2 1.4v9.9h-5.9q0-7.1 0-11.6t0-5.3l0-0.9h5.9v2.6h0q0.4-0.6 0.7-1t1-0.9 1.6-0.8 2-0.3q3 0 4.9 2t1.9 6z\"\/><\/svg><\/span><\/a><\/li><li class=\"shariff-button xing\" style=\"background-color:#ccc\"><a href=\"https:\/\/www.xing.com\/spi\/shares\/new?url=https%3A%2F%2Fwww.defrent.de%2Ffr%2F2014%2F03%2Fpreparing-half-translated-bilingual-xml-for-trados-studio-with-xslt%2F\" title=\"Envoyer par XING\" aria-label=\"Envoyer par XING\" role=\"button\" rel=\"noopener nofollow\" class=\"shariff-link\" style=\"; background-color:#79b428; color:#fff\" target=\"_blank\"><span class=\"shariff-icon\" style=\"\"><svg width=\"32px\" height=\"20px\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 25 32\"><path fill=\"#126567\" d=\"M10.7 11.9q-0.2 0.3-4.6 8.2-0.5 0.8-1.2 0.8h-4.3q-0.4 0-0.5-0.3t0-0.6l4.5-8q0 0 0 0l-2.9-5q-0.2-0.4 0-0.7 0.2-0.3 0.5-0.3h4.3q0.7 0 1.2 0.8zM25.1 0.4q0.2 0.3 0 0.7l-9.4 16.7 6 11q0.2 0.4 0 0.6-0.2 0.3-0.6 0.3h-4.3q-0.7 0-1.2-0.8l-6-11.1q0.3-0.6 9.5-16.8 0.4-0.8 1.2-0.8h4.3q0.4 0 0.5 0.3z\"\/><\/svg><\/span><\/a><\/li><li class=\"shariff-button facebook\" style=\"background-color:#ccc\"><a href=\"https:\/\/www.facebook.com\/sharer\/sharer.php?u=https%3A%2F%2Fwww.defrent.de%2Ffr%2F2014%2F03%2Fpreparing-half-translated-bilingual-xml-for-trados-studio-with-xslt%2F\" title=\"Envoyer par Facebook\" aria-label=\"Envoyer par Facebook\" role=\"button\" rel=\"nofollow\" class=\"shariff-link\" style=\"; background-color:#79b428; color:#fff\" target=\"_blank\"><span class=\"shariff-icon\" style=\"\"><svg width=\"32px\" height=\"20px\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 18 32\"><path fill=\"#3b5998\" d=\"M17.1 0.2v4.7h-2.8q-1.5 0-2.1 0.6t-0.5 1.9v3.4h5.2l-0.7 5.3h-4.5v13.6h-5.5v-13.6h-4.5v-5.3h4.5v-3.9q0-3.3 1.9-5.2t5-1.8q2.6 0 4.1 0.2z\"\/><\/svg><\/span><\/a><\/li><li class=\"shariff-button twitter\" style=\"background-color:#ccc\"><a href=\"https:\/\/twitter.com\/share?url=https%3A%2F%2Fwww.defrent.de%2Ffr%2F2014%2F03%2Fpreparing-half-translated-bilingual-xml-for-trados-studio-with-xslt%2F&text=Preparing%20half-translated%20bilingual%20XML%20for%20Trados%20Studio%20%E2%80%93%20with%20XSLT\" title=\"Envoyer par X\" aria-label=\"Envoyer par X\" role=\"button\" rel=\"noopener nofollow\" class=\"shariff-link\" style=\"; background-color:#79b428; color:#fff\" target=\"_blank\"><span class=\"shariff-icon\" style=\"\"><svg width=\"32px\" height=\"20px\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 24 24\"><path fill=\"#000\" d=\"M14.258 10.152L23.176 0h-2.113l-7.747 8.813L7.133 0H0l9.352 13.328L0 23.973h2.113l8.176-9.309 6.531 9.309h7.133zm-2.895 3.293l-.949-1.328L2.875 1.56h3.246l6.086 8.523.945 1.328 7.91 11.078h-3.246zm0 0\"\/><\/svg><\/span><\/a><\/li><\/ul><\/div>\n<p>More and more translation clients, especially in the Web industry, but also in application <span title=\"I18N: Internationalization \/ L10N: Localization\">I18N\/L10N<\/span>, <strong>use the versatile <span title=\"eXtensible Markup Language\">XML<\/span> standard for translation<\/strong> purposes. The market leader of Computer Aided Translation (CAT) Tools, SDL&rsquo;s Trados Studio, allows to translate XML with an \u00ab\u00a0Any XML\u00a0\u00bb input filter, which includes an assistant that lets you choose which XML tags and attributes will be visible in the editor as \u00ab\u00a0translatables\u00a0\u00bb. Unfortunately, this means that the source strings will be overwritten with the translation \u2014 a bad idea if the source file is already <em>bilingual<\/em> XML that contains source and target language strings in matched tags.<\/p>\n\n\n\n<p>If the target strings are empty, you can easily copy the content over and translate right away. But if the file is already partly translated, things get a bit more tricky, since you want to avoid overwriting existing translations. Worse, if the client happily announces that the source of some of the translated strings has changed, things get more than just a bit tricky. Let&rsquo;s have a look at how to prepare those files with <span title=\"eXtensible Stylesheet Language Transformation(s)\">XSLT<\/span>!<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>Alright, you have seen XML already, don&rsquo;t you? Right. Looks similar to HTML, but you get to define the valid structure and tags in your own DTD. This basically means that while HTML is mainly used to <em>display<\/em> structured information to the human user, XML&rsquo;s primary purpose is to <em>contain<\/em> structured information of any kind for humans and machines alike, and let separate stylesheets worry about how it will be displayed (e.g., as XHTML, PDF, LaTeX, CSV tables, plain text, you name it). If you want to know more, have a look at the <a title=\"W3Schools: XML\" href=\"http:\/\/www.w3schools.com\/xml\/default.asp\" target=\"_blank\" rel=\"noopener noreferrer\">XML<\/a> and <a title=\"W3Schools: XSL\" href=\"https:\/\/www.w3schools.com\/xml\/xsl_intro.asp\" target=\"_blank\" rel=\"noopener noreferrer\">XSLT<\/a> pages over at W3schools.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The XML file<\/h2>\n\n\n\n<p>Let&rsquo;s first have a look at the file we want to translate with Trados (or the free\/open source <a title=\"OmegaT : Open-Source Translation Memory\" href=\"http:\/\/omegat.org\/\" target=\"_blank\" rel=\"noopener noreferrer\">OmegaT<\/a> plus <a title=\"Okapi Translation Framework: File conversion, QA, and more\" href=\"http:\/\/okapi.opentag.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">Okapi Rainbow<\/a> combo, or any other CAT tool):<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;\n&lt;uistrings text=&quot;de-DE&quot; translation=&quot;en-US&quot;&gt;\n  &lt;string id=&quot;001&quot;&gt;\n    &lt;text&gt;Die Verbindung konnte nicht aufgebaut werden: {0}.&lt;\/text&gt;\n    &lt;translation&gt;Couldn&#039;t establish the connection: {0}.&lt;\/translation&gt;\n  &lt;\/string&gt;\n  &lt;string id=&quot;002&quot;&gt;\n    &lt;text&gt;Falsches Datum {0} im Feld &quot;{1}&quot;: Geben sie ein Datum nach dem {2} an.&lt;\/text&gt;\n    &lt;translation&gt;&lt;\/translation&gt;\n  &lt;\/string&gt;\n  &lt;string id=&quot;003&quot;&gt;\n    &lt;text&gt;Ihre Eingaben werden von der Heisenberg &amp;amp; S\u00f6hne GmbH verarbeitet.&lt;\/text&gt;\n    &lt;translation&gt;Your entries will be processed by Heisenberg &amp;amp; Planck GmbH.&lt;\/translation&gt;\n  &lt;\/string&gt;\n&lt;\/uistrings&gt;\n<\/pre><\/div>\n\n\n<div style=\"float: right; width: 30%; margin: 0 0 1.0em 0.5em; padding: 0.25em; background-color: #bdd777; border-radius: 5px;\">Sometimes, clients will wrap HTML into those tags as <em>Character Data<\/em> (<code>&lt;![CDATA[ ]]&gt;<\/code>), which means you will get to see every tag in the translation environment as plain text. Be careful with those tags! <strong>Dear Clients<\/strong>: Using CDATA may lead to messed-up code during the translation, please try to use <a title=\"W3Schools: XML Namespaces\" href=\"http:\/\/www.w3schools.com\/xml\/xml_namespaces.asp\" target=\"_blank\" rel=\"noopener noreferrer\">namespaces<\/a> instead to enclose HTML in XML, then they will be correctly parsed and displayed as immutable tags and the translator is less likely to forget or mangle a tag somewhere.<\/div>\n\n\n\n<p>The file starts with the XML file declaration including version and encoding. The mandatory \u00ab\u00a0root element\u00a0\u00bb <code>uistrings<\/code> encompasses all other tags, it also holds the source and target languages as attributes. Inside, we can see three <code>string<\/code> tags with their IDs as attributes, each with one <code>text<\/code> and one <code>translation<\/code> tag with the actual source and target content. <em>Attention:<\/em> If the file is saved as ANSI instead of UTF-8, the Umlaut and Ampersands might throw parsing errors and should be replaced with Entities!<\/p>\n\n\n\n<p>I have inserted three use cases: The string is already accurately translated, the string is untranslated (empty <code>translation<\/code> tag) and the string is translated but the <code>translation<\/code> doesn&rsquo;t match the <code>text<\/code> (here: the company name has changed). Unfortunately, our virtual client has not marked that string as modified, for example by setting something like a <code>new<\/code> or <code>modified=\"yes\"<\/code> attribute on the <code>string<\/code> or <code>text<\/code> element.<\/p>\n\n\n\n<p>So, we have already translated strings, empty strings and strings that need to be edited. Usually, you would want to write your translations into the <code>translation<\/code> elements. However, telling Trados to parse the <code>translation<\/code> elements as translatables will lead to English text in TagEditor&rsquo;s German source column for strings 001 and 003, and you won&rsquo;t get to see string 002 at all, because it&rsquo;s empty and nobody would ever need to translate \u00ab\u00a0nothing\u00a0\u00bb, right? And on top of that, you won&rsquo;t ever get to see the German source text.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">File preparation<\/h2>\n\n\n\n<p>Apparently, what we need to do before translating the <code>translation<\/code> elements is to copy the source <code>text<\/code>, preferably without destroying extant translations. One way to achieve this is by using a text editor with <a title=\"All about regular expressions\" href=\"http:\/\/www.regular-expressions.info\/\" target=\"_blank\" rel=\"noopener noreferrer\">Regular Expression<\/a> Search&amp;Replace functionality to turn the whole XML thing into a tab-separated table, save as .TXT, use Trados text table input filter to read and translate the file and turn it back into an XML document with another RegEx. <a title=\"Trados Studio 2011 und bilinguales XML\" href=\"http:\/\/www.defrent.de\/2014\/01\/trados-studio-2011-und-bilinguales-xml\/\">Been there (article in German)<\/a>, it works quite nicely and you automatically have the source text in TagEditor&rsquo;s source column and any existing translations in the target column. But let&rsquo;s try using only XML this time, shall we?<\/p>\n\n\n\n<p>XML and XSL are like HTML and CSS on steroids. Not only can XSL present XML data in a number of other languages, it also lets you convert one XML file into another, use variables, copy and move elements, and even use control structures such as <code>if<\/code>. One (good) use is to convert our XML file into an HTML file showing us three columns: ID, text and translation &#8211; and tell Trados in the file type options to use that .xsl stylesheet to display the preview window. Trados will even mark the currently edited segment with a red box in that preview, and we have our source and target sitting nicely side by side instead of having to stare at XML code. Example:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;\n&lt;xsl:stylesheet xmlns:xsl=&quot;http:\/\/www.w3.org\/1999\/XSL\/Transform&quot; version=&quot;2.0&quot;&gt;\n&lt;!-- Sample XSL Stylesheet to display the above XML file as a HTML table in Trados&#039; preview window --&gt;\n&lt;xsl:output method=&quot;html&quot; indent=&quot;yes&quot; encoding=&quot;utf-8&quot; doctype-public=&quot;-\/\/W3C\/\/DTD HTML 4.01 Transitional\/\/EN&quot;\/&gt;\n&lt;!-- What follows is regular HTML, except in tags with the namespace prefix xsl: --&gt;\n&lt;xsl:template match=&quot;\/uistrings&quot;&gt; &lt;!-- XML root element of our file --&gt;\n&lt;html&gt;\n  &lt;head&gt;\n    &lt;title&gt;Preview&lt;\/title&gt;\n  &lt;\/head&gt;\n  &lt;body&gt;\n    &lt;table width=&quot;100%&quot; style=&quot;border:1px solid #999;&quot; cellpadding=&quot;2px&quot; cellspacing=&quot;0px&quot;&gt;\n       &lt;tr style=&quot;background-color:black;&quot;&gt;\n          &lt;th style=&quot;color:white;&quot; width=&quot;15%&quot;&gt;ID&lt;\/th&gt;\n          &lt;th style=&quot;color:white;&quot;&gt;Source&lt;\/th&gt;\n          &lt;th style=&quot;color:white;&quot;&gt;Target&lt;\/th&gt;\n       &lt;\/tr&gt;\n      &lt;xsl:for-each select=&quot;string&quot;&gt; &lt;!-- Loop through all string elements in XML file and create table rows: --&gt;\n       &lt;tr&gt;\n          &lt;td color=&quot;blue&quot; width=&quot;15%&quot;&gt;&lt;xsl:value-of select=&quot;.\/@id&quot;\/&gt;&lt;\/td&gt;\n          &lt;td&gt;&lt;xsl:value-of select=&quot;.\/text&quot;\/&gt;&lt;\/td&gt;\n          &lt;td&gt;&lt;xsl:value-of select=&quot;.\/translation&quot;\/&gt;&lt;\/td&gt;\n       &lt;\/tr&gt;\n      &lt;\/xsl:for-each&gt;\n    &lt;\/table&gt;\n  &lt;\/body&gt;\n&lt;\/html&gt;\n&lt;\/xsl:template&gt;\n&lt;\/xsl:stylesheet&gt;\n<\/pre><\/div>\n\n\n<p>But it gets even better: As I have said already, such an XSL sheet can also transform one XML file into another XML file, and that&rsquo;s where we can make that whole CAT translation thingy work, because Trados actually has a special XML filetype that is bilingual and that is read and displayed and edited correctly: XLIFF, the Translation (abbreviated XL) Interchange File Format, which is used by Trados and almost all other major CAT tools (as an import\/export format if not natively). XLIFF is for bilingual texts what TMX is for translation memories.<\/p>\n\n\n\n<p>This is how XLIFF can be generated by XSLT from our XML file:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;\n&lt;xsl:stylesheet version=&quot;1.0&quot; xmlns:xsl=&quot;http:\/\/www.w3.org\/1999\/XSL\/Transform&quot; xmlns:xliff=&quot;urn:oasis:names:tc:xliff:document:1.1&quot; exclude-result-prefixes=&quot;xliff&quot;&gt;\n&lt;!--This XSL Stylesheet will output XLIFF, XLIFF prefixes shall not appear in the resulting file --&gt;\n&lt;xsl:output method=&quot;xml&quot; indent=&quot;yes&quot;\/&gt;\n&lt;xsl:template match=&quot;\/uistrings&quot;&gt; &lt;!-- Start with our root element and create XLIFF: --&gt;\n&lt;xliff xmlns=&quot;urn:oasis:names:tc:xliff:document:1.1&quot; version=&quot;1.1&quot;&gt;\n&lt;file source-language=&quot;de-DE&quot; datatype=&quot;plaintext&quot; target-language=&quot;en-US&quot;&gt; &lt;!-- datatype could also be &quot;html&quot;! --&gt;\n  &lt;body&gt;\n    &lt;xsl:for-each select=&quot;string&quot;&gt;\n      &lt;trans-unit id=&quot;{.\/@id}&quot;&gt;\n         &lt;source xml:lang=&quot;de-DE&quot;&gt;&lt;xsl:value-of select=&quot;.\/text&quot;\/&gt;&lt;\/source&gt;\n         &lt;target xml:lang=&quot;en-US&quot;&gt;&lt;xsl:value-of select=&quot;.\/translation&quot;\/&gt;&lt;\/target&gt;\n      &lt;\/trans-unit&gt;\n    &lt;\/xsl:for-each&gt;\n  &lt;\/body&gt;\n&lt;\/file&gt;\n&lt;\/xliff&gt;\n&lt;\/xsl:template&gt;\n&lt;\/xsl:stylesheet&gt;\n<\/pre><\/div>\n\n\n<p>How it works: We begin with our usual <code>xml<\/code> file type declaration, followed by the declaration that this is going to be an <code>xsl:stylesheet<\/code>, including the XSL version and namespaces for XSL and XLIFF. We also add that we don&rsquo;t want to see <code>xliff:<\/code> prepended to any element in the output file. Then we proceed to the desired <code>output<\/code>, which is going to be XML and shall be indented for better readability. To define how our XLIFF file should look like, we begin our <code>xsl:template<\/code> at the <code>uistrings<\/code> root element (the one which holds all other elements) of our sample XML file.<\/p>\n\n\n\n<p>The first line that will be written into the new file is its own file type declaration (<code>xliff<\/code>), together with its namespace, followed by a <code>body<\/code> element. Then, we begin iterating through our <code>strings<\/code> from the XML file: For each <code>string<\/code>, we write one <code>trans-unit<\/code> carrying the <code>id<\/code> as its attribute. Each one will contain one <code>source<\/code> and one <code>target<\/code> element with the content of the original <code>text<\/code> and <code>translation<\/code> elements. Then we end the loop, neatly close our <code>body<\/code>, <code>file<\/code> and <code>xliff<\/code> tags and end the <code>xsl:template<\/code>. And that&rsquo;s also the end of our <code>xsl:stylesheet<\/code>. Easy, isn&rsquo;t it? You just need to know how your desired file must look like and insert the content into the corresponding places \u2013 the <code>for-each<\/code> statement does the rest.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Convert to XLIFF, translate, convert back<\/h2>\n\n\n\n<p>Now let&rsquo;s see if it works! You can download Apache&rsquo;s Xalan XSLT processor either as a C binary or as a Java app (<a title=\"Download Xalan C\" href=\"http:\/\/xalan.apache.org\/xalan-c\/download.html\" target=\"_blank\" rel=\"noopener noreferrer\">Xalan-C<\/a> \/ <a title=\"Download Xalan J\" href=\"http:\/\/xml.apache.org\/xalan-j\/\" target=\"_blank\" rel=\"noopener noreferrer\">Xalan-J<\/a>). Personally, I find the Xalan-C to be less of a hassle: You download the xalan-comb-&#8230; package for your system (usually x86-windows or amd64-windows) right from <a title=\"Download latest Xalan C 'COMB' package\" href=\"http:\/\/xalan.apache.org\/xalan-c\/index.html\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>, extract the archive, drop the contents from the Xerxes directory into the Xalan directory (integrate the folders bin, include and lib) and there you go. There are other XSLT processors, but Xalan is open source, free, libre and easy to work with.<\/p>\n\n\n\n<p>Once you are done extracting (no real \u00ab\u00a0installation\u00a0\u00bb required), copy the above XML file code (the first code box) and paste it into an empty text file. Save that as <code>test.xml<\/code>. Likewise, copy the code from the last sample XSL sheet and save that as <code>test2xliff.xsl<\/code>. From the Xalan \u00ab\u00a0bin\u00a0\u00bb directory, do: <code>xalan.exe -o testoutput.xlf test.xml test2xliff.xsl<\/code> &#8211; be sure to include the full path to where you saved the test files, e.g. <code>xalan.exe -o C:\\Users\\Me\\Documents\\XMLtest\\testoutput.xlf C:\\Users\\Me\\Documents\\XMLtest\\test.xml C:\\Users\\Me\\Documents\\XMLtest\\test2xliff.xsl<\/code><\/p>\n\n\n\n<p>Subsequently, you can open the .XLF (short form of .XLIFF) with Trados File\/Open command and translate that. For me, it worked without hassles.<br><strong>Wham!<\/strong><br>Now you know how to write an XSL transformation into XLIFF. Will you be able to write a similar XLS transformation to convert the XLIFF back into the original XML file format? Try it out and tell me!<\/p>\n\n\n\n<p>Cheers,<br>Christopher K\u00f6bel of <a title=\"DeFrEnT\" href=\"http:\/\/www.defrent.de\/\" target=\"_blank\" rel=\"noopener noreferrer\">DeFrEnT<\/a><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>More and more translation clients, especially in the Web industry, but also in application I18N\/L10N, use the versatile XML standard for translation purposes. The market leader of Computer Aided Translation (CAT) Tools, SDL&rsquo;s Trados Studio, allows to translate XML with an \u00ab\u00a0Any XML\u00a0\u00bb input filter, which includes an assistant that lets you choose which XML<\/p><\/div>\n<div class=\"blog-btn\"><a href=\"https:\/\/www.defrent.de\/fr\/2014\/03\/preparing-half-translated-bilingual-xml-for-trados-studio-with-xslt\/\" class=\"home-blog-btn\">Lire la suite<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[21,23],"tags":[77,81,82,83,84],"class_list":["post-695","post","type-post","status-publish","format-standard","hentry","category-de","category-howto-de","tag-trados-studio","tag-xliff","tag-xml","tag-xsl","tag-xslt"],"aioseo_notices":[],"featured_image_src":null,"featured_image_src_square":null,"author_info":{"display_name":"Christopher K\u00f6bel","author_link":"https:\/\/www.defrent.de\/fr\/author\/defrenter\/"},"_links":{"self":[{"href":"https:\/\/www.defrent.de\/fr\/wp-json\/wp\/v2\/posts\/695","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.defrent.de\/fr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.defrent.de\/fr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.defrent.de\/fr\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.defrent.de\/fr\/wp-json\/wp\/v2\/comments?post=695"}],"version-history":[{"count":17,"href":"https:\/\/www.defrent.de\/fr\/wp-json\/wp\/v2\/posts\/695\/revisions"}],"predecessor-version":[{"id":1632,"href":"https:\/\/www.defrent.de\/fr\/wp-json\/wp\/v2\/posts\/695\/revisions\/1632"}],"wp:attachment":[{"href":"https:\/\/www.defrent.de\/fr\/wp-json\/wp\/v2\/media?parent=695"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.defrent.de\/fr\/wp-json\/wp\/v2\/categories?post=695"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.defrent.de\/fr\/wp-json\/wp\/v2\/tags?post=695"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}