XML - Extensible Markup Language (TMS) - Phrase
XML - Extensible Markup Language (TMS) - Phrase
Enter keywords
Phrase TMS Phrase Strings Phrase Orchestrator Global Release notes Release Notes Archive
The .XML file format is not designed for translation and requires additional settings for successful
import.
Default settings are marked with an asterisk (*) and will import all XML elements for translation.
Import options can be used to change the import behavior.
File Types
.XML
Import Options
Plain import rules
Elements
Only selected elements (i.e. name, title, para) are imported. An asterisk (*) imports all elements.
Attributes
Only selected attributes (i.e. name, title, para) are imported. An asterisk (*) imports all attributes.
Translatable inline elements
If the Identify inline elements automatically option is selected, all elements in the translatable text
are imported as Translatable inline elements.
Selected inline element name, title, para will be converted into tags and content will not be
translatable.
Elements that are neighbors of text nodes will be automatically converted to inline tags.
Selected element code is processed as .HTML. HTML Import Settings such as Preserve
Whitespaces or Break tag (<br/>) creates new segment can be used for these elements.
Locked elements
Locked attributes
ICU messages are automatically converted to tags. Files with ICU messages cannot contain any
inline elements.
Segment XML
Import comments
Comments are not imported if elements are processed as HTML as indicated in the Elements
(processed as HTML) option.
Example:
If quotation marks (") are required, they would be represented as " , the character Σ
would be represented as Σ use ",Σ . & and < are always exported as
& and < respectively.
Using the XPath query language allows for the creation of complex import rules and some
additional features unavailable in plain import rules.
XPath expression should define the elements and/or attributes whose text/value should be
translated and not the actual text node.
Context note, Context key, and Max. target length will not be processed for files with more than
10,000 XML elements.
Context key
Context note
Import elements or the maximum target length for each element. The character limit for each
segment is displayed on the Context note pane inside the editor. Any character exceeding the
limit is highlighted in red.
Preserve whitespaces
If CDATA contains embedded .HTML, the corresponding XML elements should be listed under
Elements (processed as HTML).
If the source file contains CDATA and the Segment XML is used then CDATA is added to every
segment in the Completed file.
CDATA will only be segmented if there is a clear indication of a segment break such as punctuation
or spacing.
Source:
Target:
The Completed file is valid .XML and the XML viewer will display the text correctly as Translatable
text A. Translatable text B.
Multilingual XML
Multilingual files are imported as multiple bilingual jobs with languages mapped before import. They
are represented with
in the jobs table . If imported into several target languages, the Completed
file is composed of all target languages.
Phrase supports XML files that have both source and target elements present for all paragraphs even
if the target is empty. When the source and target segmentation are different, the source
segmentation is determining.
Individual language elements must all be descendants of the same trans-unit element and one
language cannot be contained within the other. Source and target content cannot be stored in
attribute values. If multiple elements match the XPath for source or target inside the trans-unit
element, only the first one is imported for translation.
When creating a job , select Multilingual XML from the File Type pane before applying Import
Options. If not specified, the file will be imported as standard .XML.
Tag content of source .XML file can be visualized in the editor by clicking Expand tags under the
Tool menu and edited by clicking F2 .
Example:
Sample of partially translated text from English to German and French. All <tuv lang="en"> ,
<tuv lang="de"> and <tuv lang="fr"> are children of the same <tu> element.
<root>
<tuv lang="en">
<seg>First segment.</seg>
</tuv>
<tuv lang="de">
<seg>Erste segment</seg>
</tuv>
<tuv lang="fr">
<seg></seg>
</tuv>
</tu>
<tu note="another context note" key="ID 255" maxlen="18">
<tuv lang="en">
<seg>Second segment.</seg>
</tuv>
<tuv lang="de">
<seg></seg>
</tuv>
<tuv lang="fr">
<seg></seg>
</tuv>
</tu>
</root>
Import Options
For the import of Multilingual .XML files, the XPath query language must be used. See example
above for reference. The XPath expression defines the elements in which the text/value should be
translated and not the actual text node.
//tu
All elements in source or target are considered Translatable inline elements unless specified here
as Non-translatable inline elements.
Context note
Enter a list of character references (separated by commas) into the output file.
Example:
If quotation marks (") are required, they would be represented as " , the character Σ
would be represented as Σ use ",Σ . & and < are always exported as
& and < respectively.
ICU messages are automatically converted to tags. Files with ICU messages cannot contain any
inline elements.
Imports HTML tags contained in the file. Tags can then be used with HTML File Import Settings.
Paragraph tags <p> will create new segments even if Segment Multilingual XML is unselected.
Text is segmented by a general segmentation rule rather than one segment per cell.
Caution
Applying Segment multilingual XML to a file that contains target text may result in a different
number of segments in the source than in the target.
Select default confirmation status and whether confirmed segments are automatically added to
TM.
Example:
If a multilingual .XML contains namespace, the XPath could be the following:
Elements containing source and target sub-elements
//*[local-name()='trans-unit']
*[local-name()='source']
*[local-name()='target']
Yes No
In this article
File Types
Import Options
HTML preview with XSLT stylesheet
CDATA in XML file
Application Specific Settings
Multilingual XML
Import Options
RESOURCES
Free Trial
Download Editor
Blog
Release Notes
Feature requests
Webinars