By default ezParse will overwrite the XML element specified in your rule with translation. However, when dealing with multi-lingual XML documents, you may want the translation to be stored in another element within the XML document, For example, in the multilingual XML document below, the source text (ie English) is defined in the element LANG with an attribute "LCID=1033", however the translation is to be stored in the element LANG only if the attribute LCID equals the value "1031".

image42.jpg

ezParse allows you to define a translation-target for each element within your rule and to define an XPATH condition for this translation-target.

In the example above, the element Text is only selected for translation if the attribute LCID has a value of "1033". In addition to this we've also specified that the element to be used to store the translation is also Text but only if the attribute LCID has a value of "1031". This ensures that when the english source text is translated, that it will be stored in the correct location of the XML document.

If we processed the sample  XML document above using this rule, the following would be included for translation:-

image43.jpg

The translation for each source text would then be stored in the correct Text element which has an attribute LCID with a of "1031".

What do you want to do?

Create a simple ezParse rule for an XML document.

Learn more about XML Documents.

Learn how to specify conditions in ezParse rules.