Task Objective

The following task is carried out by the Localization Engineer . In this task an ezParse rule will be created to extract only translatable text from an XML document and leave all untranslatable text hidden. He uses ezParse to write a rule to accomplish this task.

Task Steps

  1. Create a new Project TTK by selecting on File - New.

  2. Click on the root of the Project TTK file, and insert the file Alchemy CATALYST.xml. When prompted, select the ezParse deafult rule ShowAll  and press OK to insert this XML document into your project.

note.bmp

The ezParse rule ShowAll will mark every element and attribute in the XML document as translatable and display the entire content of the document in the Project Workspace pane.

 
xml002.bmp

While every element is displayed on the screen and can be translated using the Translators Toolbar, the flow of each paragraph and sentence is broken each time an inline tag

Use ezParse to improve on the segmentation and display of this XML document.

  1. Go to Tools - Options and select ezParse. In the File Extension list, select *.xml. Click the Add button and type Freeform as the name for the new rule.

  2. Click on Edit Rule to create an ezParse rule for this XML document.

xml003.bmp

  1. In the Methods section, click  the browse button and locate the file Alchemy CATALYST.xml. Press OK to load this file into ezParse.

  2. A list of elements and attributes will be displayed in the Mark-up data grid. Use this Mark-up data grid to create a new ezParse rule.

  1. To display an element in Alchemy CATALYST click on it and switch it to Green. For example the element image129.gif is marked for display whereas the element image130.gif is not.

  2. Mark all the following elements for display leaving all other elements un marked. P-Element, P-Header1, P-BodyTextBlock, B, I and H2.

Tags that are to be displayed

Tags that are not to be displayed

image132.gif

image131.gif

Go to the B, I and H2 elements and click the check box in the Inline Tag column. This instructs ezParse to process these elements as inline tags and not to split them over multiple segment  boundaries.

There are several methods that can be used to process each element in an XML document:

point.bmp

Locked

 

Select this method to lock an element or attribute. Applying a lock ensures that this element or attribute is displayed but cannot be modified during the translation process.

point.bmp

In-Line

 

Select this method to identify elements and attributes that are to be treated as inline tags.  An example of such an element would be bold or underline. This is frequently used when translating paragraph based text segments within XML documents.

point.bmp

Code-Segment

 

Select this method to identify elements that contain code (for example, JavaScript, ASP, CGI, Pearl).  Alchemy CATALYST can then be configured to parse that code segment and extract translation units for display within the XML editors. For more information, see Developing ezParse™ Rules.

point.bmp

Id

 

Select this method if an element can be identified using an unique ID. This is very useful for aligning XML documents or improving the accuracy of translation re-use.

 

  1. Click on the Preview button to see the results of the ezParse rule in the Preview Panel in the bottom left hand corner of the screen.

xml004.bmp

  1. Press the OK button to save the ezParse rule.

Congratulations! You've just created your first ezParse rule that processes XML documents.