XML Files

 

This topic is obsolete as of January 2007.  Please refer to the RC-WinTrans Developer Help Topic "XML Parser."

 

RC-WinTrans uses an XSLT transformation files based  file converter to convert an  XML file into a XLIFF format file to be translated with RC-WinTrans.

1.Tthe converter converts an  XML file to an  XLIFF format file and
2. the translated RC-WinTrans XLIFF data file to the translated target XML file.

 

For a step-by-step description how to enable (add) an XML files converter see:
Adding an XML format converter to RC-WinTrans
.

 

NOTE FOR DEVELOPERS: Technically an XML converter is realized/implemented as a pair of two XSLT transformation files. The XSLT files are used by Visual Basic macros which are the implementation of XML files converter used by RC-WinTrans.

Overview

XML files may come in most diverse flavours. Thus, it is generally insensible to allow only one converter for all XML files. On the "XML Files Converter" settings page, you may associate "converters" to different types of XML files.

An XML "converter" is (minimally) a set of two XSL Transformation (XSLT) files:

  • the first XSLT file performs the conversion from your XML format to XLIFF (as understood by RC-WinTrans)

  • the second XSLT file performs the conversion from RC-WinTrans' XLIFF file back to your XML format

Here we are not describe the details of the XSL Transformation language. However, XSLT is a W3C standard, and there are many books out on XSLT.

As an example, we provide a set of simple XSLT files that can be used to localize the text content of other XSL Transformation files. (XSL Transformation files are XML files, too.)

To incorporate the XML file converter within RC-WinTrans, you most likely need to look at two places:

  • the File Converters dialog to associate a file extension with the XML converter (e.g., "xml", "xsl", "xslt"…)

  • the XML Files Converter HTML GUI page to associate a "distinguishable" XML file type with two XSL Transformation files

This topic only covers the XML Files Converter HTML GUI page.

 

Image 1: XML Files Converter dialog box ("listing" view).

 

In our example, we have only one file type—"XSL Transformations". You have three options:

  • to create a new XML file type association, press the Add Type  button

  • to delete an existing XML file type association, first select the respective table entry below File Type and then press the Del Type  button

  • to change the settings for an existing XML file type association, first select the respective table entry below File Type and then press the Edit Type button

After pressing either the Add Type or the Edit Type button, a small form comes up for the XML file type association that you want to edit—with the File Type table remaining visible but changing to "inactive" mode.

 

Image 2: XML Files Converter dialog box ("edit" view)

 

In the Edit XML File Type form, there are specified four values:

  • a short descriptive name for the file type (shows up in the File Type table above)

  • the root element of the XML files you want to localize; for XSLT files, the root element is usually <xsl:stylesheet>. We leave out the <> XML "brackets" and write xsl:stylesheet. For a TMX file, we would write tmx as the root element is always <tmx>

  • the location of the XSL Transformation file which performs the conversion from your XML file type to Xliff (Transformation 1)

  • the location of the XSL Transformation file which performs the conversion back, i.e. from RC-WinTrans' Xliff file to your XML file type (Transformation 2); both transformation files may be selected interactively using the ... buttons beside.

To store your changes, press the OK button. To discard the edits, press the Cancel  button. In both cases, the dialog will return to its initial view (Image 1).