Defining XML Rules |
When an XML document is inserted into Alchemy CATALYST, both the markup and content are processed, however unless an element/attribute is selected to be localized, it will not be displayed in the workspace. By default, Alchemy CATALYST assumes nothing is to be translated in an XML document unless a rule defines that the element/attribute is to be translated. You need to create a parsing rule.
Follow these instructions to specify an element/attribute for translation, to create a parsing rule:
Go to HOME > File types & Parsing Rules.
Click on XML Based Files in the File Group list. Then select the .xml file extension.
Several rules are available by default.
Select a rule name or create a new rule and click the Edit Rule button.
Catalyst enables you to append to an existing rule which was created for a different XML file. This means
In the Edit Methods Dialog, click on the browse button under Template to point to the XML document you wish to create the rules for.
A list of elements and attributes now displays. By selecting suitable methods, you can instruct Alchemy CATALYST on processing XML documents.
By selecting an existing rule name (in point 3), you can modify or append to this rule. Selecting a template will not overwrite the existing list of elements and attributes but will append to the list, highlighted in green to differentiate the new from the existing elements.
To select elements & attributes' content for translation, simply double-click on it. Its color changes when it is selected for translation.
In the picture above, the "item" element has been selected as translatable and is highlighted. All other elements & attributes in white will not be parsed in the string list using this rule.
Click on Toggle All to set all elements & attributes as translatable. Click again on the button to deselect all as translatable.
The Elements count is the number of elements & attributes listed, regardless of being selected of not for translation.
To select a method, click the check-box in the appropriate column adjacent to each element or attribute.
There are several methods that can be used to process an element/attribute,
Once you have selected each elements & attributes for translation you can save the rule by clicking OK. And then OK again on the ezParse dialog.
Your Rule is now automatically saved in the Alchemy CATALYST registry. Next time you insert an XML document into a Project TTK, you will be prompted to select the appropriate rule for your XML document from a list displayed on the screen. Alchemy CATALYST will then process the XML document based on the rule you have selected and display only those elements specified for translation in the workspace pane.
If you have XML files with continually changing structure/element names or lots of different files with different attribute and element names then you may find that it requires a lot of work to create an individual ezParse rule for each XML file to be localized. Alchemy CATALYST simplifies this process by providing a rule called Show All. This is a default rule that displays all elements/attributes in an XML document so that it can easily be translated without creating a custom rule for it.
This Show All rule is always presented as an option when an XML document is inserted into a Project TTK.
Learn more about XML Documents.
Learn how to specify conditions in ezParse rules.
Learn how to define a translation-target in multi-lingual XML documents.