Configuring a DST for Conditional XML
The following instruction demonstrates the use of Conditional XML on the basis of a simple XML document.
The document contains the external element <p>, which occurs three times in the example document. On the one hand as a normal element without attribute (1). On the other hand the element occurs two times with the attribute translate (2 and 3) and different attribute values in each case. In the first case, the element content is to be translated (attribute value yes; see 2) and therefore displayed in the normal way in Across. In the second case, however, the element content is not to be translated (attribute value no; see 3). Accordingly, the element content is to be displayed as locked for the translator in Across.
In Across, the implementation of these attribute values can be mapped with the help of conditions (Conditional ML).
- Proceed as follows:
- Access the document settings template in which you want to determine conditions via Tools > >System Settings > Document Settings.
- There, select the desired format (Tagged HTML, SGML or XML; in this example: Tagged XML).
- Select the requested template via the drop-down list under Document settings template.
- To customize the processing of XML elements, these elements must first be inserted in the template. Usually, the easiest way to do this is to import the document or the DTD in the document settings template by means of Load. In this way, all elements contained in the document are written to the document settings template for quick and easy customizing.
- Select the external element for which you want to define conditions.
- Click Edit.
- Select the external element type and the Conditional option.
- Click Settings in order to define the conditions.
- Click Add.
The element to be adapted is displayed (in our case <p>).
- Click Add attribute in order to define the first condition for the attribute translate.
- If you have imported the XML document to the document settings template, you can select the desired attribute from the drop-down list on the left (in our case, the attribute translate). Otherwise, enter an attribute manually. The name of the attribute must correspond exactly to the attribute name in the XML document.
- In the right input field, enter the value of the attribute (in this case, yes). Here, too, the attribute value must correspond exactly to the attribute value in the XML document.
- Click OK.
- From the drop-down list, select the desired processing and display mode in Across.
In this case, select Normal, as the element contents with the attribute value yes are to be edited by the translator in the normal way, i.e. they are to be translated.
- Click OK.
- The condition has been added and represented in the form of an XPath expression. Click Add and Add attribute in order to define the second condition for the attribute translate. Tip
XPath (XML Path Language) is a language used to address parts of an ML document. It can be used to address specific nodes of these documents.
- From the drop-down list on the left, select the desired attribute (in this case, translate) and enter the value of the attribute in the right input field (in this case, no).
- Click OK.
- From the drop-down list, select the desired processing and display mode in Across. In our case Locked, as the element contents with the attribute value no are not to be translated. However, the contents are to be displayed to the translator.
If you select Hide, the content will not be visible to the translator.
- Click OK.
- The second condition, too, is added and represented in the form of an XPath expression. In this way, both conditions have been defined. Click Close and OK.
- Now the XML document can be checked in to Across as Tagged XML on the basis of the customized document settings template.
Element contents without condition are displayed in the normal way (1). In line with the first defined condition, the contents with the attribute value yes are displayed in the normal way in crossDesk and can be edited by the translator (2). Element contents with the attribute value no are displayed as blocked for the translator, in accordance with the second defined condition. This is evident from the gray background of the respective paragraph (see 3) and from the icon in crossView.
If you adapt the document settings template for a document that has already been checked in and want to apply the changed template to the document, all you need to do is update the unchanged document. Select the previously customized template as the template (not the Current document settings template option).