On this page you will find all XML configuration options to extract the texts you want to be translated or also keep as reference in the Editor from any files format; .xml.
Customise or create a new extraction profile
You can rearrange the default profile to work the way you want, create new ones using the Add new option or even create copies of the existing profiles using the little arrow next to select.
Clicking on the arrow will give you more options to chose from
Once you have selected your working profile, you can edit the configuration. Keep reading to know which are the key features in every profile
The most important options are the file encoding and one or more XPATH expressions to specify which XML nodes or attributes are to be extracted for translation.
Monolingual vs Multilingual content
Make sure you use the right configuration if you are eager to retrieve texts from a multilingual file. If your XML file just has texts in one language, then the default setting is fine.
Define the nodes that need to be extracted for translation and the nature of their contents. Additionally, you can define other nodes which contain useful information to be kept as context in the properties of the segment:
In the example above:
- all "element" nodes having an attribute "type" of value "text" will be extracted
- the node contents are plain text.
- all "element" nodes with "type" equals "html".
- the content of these nodes is HTML (HTML can be in CDATA sections or just be XML encoded)
For both node types, context information has been defined (the attribute title of the node is kept as such)
Find out some nice examples to get started in the page below:
Xpath Tool. How does it work
Use the Xpath builder tool to easily identify which are the nodes that require translation. Just follow this simple steps;
- Copy your XML code in the window
- Run the builder
- See the nodes highlighted in the bottom left corner
You can either work with your own pieces of code or select an example from the dropdown in the top left corner.
Save and test the new rule
- Save your configuration: Click Save in the top right of the page.
- Test your configuration with the Test configuration link. This will open a dialog where you can upload your XML file and see what content is extracted.
Custom fields and context properties won't be extracted using the test configuration link. You will need to use the parser in a project to validate these. Keep reading below
Validate your configuration
- Mark a file for online translation in a project using the parser you just configured
- Check that the contents are displayed as you wish in the editor
Generate the target file and check that the structure is not corrupted
Make sure that all contents are present in the generated file. This means all nodes, translatable and ignored.