Documentation Center

Working with Rules

You can define different rules to be used as required, depending on the root element of the XML file. Rules are defined and edited in the XML Parser Rules dialog.

The list on the left side shows all the rules defined so far. If you select one of the rules, the corresponding settings for this rule are displayed in the fields on the right.

The rules can be saved in different locations:

The standard rules are the rules that are available following the installation of SDL Passolo. These rules cannot be modified.

The user rules are saved on the computer. You can define your own rules here or modify the existing standard rules. This is done by dragging the respective standard rule into the area for user rules.

You can also embed rules in a project. This ensures that the rule are available, even when the project is opened on a different computer.

When a source file is read in with the XML parser, Passolo saves the name of the rule used. When the source string list is updated, Passolo searches for the relevant rule in this sequence:

  • In the project
  • In the user rules
  • In the standard rules

To add a new rule to the user rules, select . A new entry is added to the list and you can enter a name for the new rule.

To change the name of the current rule, select .

To delete the selected rule, select .

Root element

In order to assign a rule to a specific XML document type, the root element of the XML file has to be specified. If Passolo encounter one of the defined root elements when importing an XML file, the localizable contents can be parsed without requiring further configuration. You can enter a single root element, or several alternatives separated by semicolons.

Resource Type

It is also possible to read XML resources contained in a file that is processed by another parser. When using such resources you can also specify the resource type. If, for example, you use a resource type XML within a WIN32 source file and you want to process the resource using a XML parser rule, you can specify the resource type XML for this rule. When parsing the source file, Passolo will then use the XML parser for these resources. You can control or modify the use of the XML parser and the relevant rule in the respective resource properties window.

File

When you define the rules for a new XML document type, you can use the visual definition mode to facilitate the specification of localizable data elements and attributes by entering a sample file here. The entry field is automatically preset to the name of the source file that was selected when the dialog was called up via the source file options. Select the option Read complete file for preview if the complete structure of the hierarchical XML tree (for the selection of localizable elements) is not contained within the first 2MB of the file. This option slows down the file preview in expert mode as well as the parsing of the file.

Settings

Contains a list of all the rule settings for the current XML file with the specified root element.

Save

Saves your changes to the rule definitions

Export

Exports the selected rules (or all the rules) to a configuration file. This allows you to send your rule definitions to other translators.

Import

Imports rule definitions from a selected configuration file created using the Export command. A list of the rules contained in the configuration file is displayed. You can select all the rules or any combination you want to import.

Rule Options

There is one option that has to be specified before an XML file is parsed or the rule is configured.

Activate the Resolve external references option if you get an error message indicating missing references (for example to entities defined in a DTD) when the source file is parsed. This error will definitely also occur when you call up the XML Rule Configuration dialog. Just like the XML parser, the configuration dialog attempts to load the XML document. This means that the Resolve external references option has to be activated before a rule can be created for the XML parser.

If this option is activated the DTDs or schemas specified in the XML file have to be accessible to the XML parser, otherwise the parser will issue an error message.

XML files often integrate DTDs and schemas without using any references. In such cases an XML file can be processed without the corresponding DTDs or schemas. In this scenario, the Resolve external references option has to be switched off.

Configuration

Opens the XML Rule Configuration dialog where the XML parser can be configured using the tree or list view.