XML v2 custom settings

The XML 2 custom file type has the *.xml extension.

Detection

When configuring the Parser section of the XML 2 custom file type, you can edit all the Parser rules manually from scratch, or adjust the Parser rules from an uploaded file and preview the results.

SettingInstruction
Root element namesType an element name and select plus sign.
xsi:schemaLocation URIsType a declaration.
DOCTYPE declaration element namesType a declaration.
Namespace declaration (xmlns) URIsType a namespace declaration and select plus sign.
xPath rulesType an XPath rule and select plus sign.

Note that if you choose to upload an *.xml file via the Using rules generation with a dynamic preview, the fields are automatically populated with information from the *.xml file, but you can still add or delete values.

Parser

OperationsInstruction
Add a rule manuallyParsing rules define how elements are handled. To add a rule:
  1. Select Add New Rule.
  2. Under Rule select either XPath rules or Element rules, and then select By manually defining the rules. If you select XPath rules, enter a value in the XPath field, if you selected Element rules, enter an element and its attribute.
  3. Under Properties, select Basic Settings and edit the following:
    • Translate: Yes (default), No, Inherit.
    • Tag Type: Structure (default), Inline.
    • Whitespace: Inherit from Parent (default), Always preserve, Always normalize, Normalize unless xml:space='preserve'
  4. Under Properties, select Advanced Settings and edit the following:
    • SID XPATH - Leave the field empty, as this option is only used by WorldServer. For more information about SID, consult the WorldServer documentation.
    • Segmentation Hint - This option is available only if you work with inline tags and only if you specified the extraction rule (segmentation hint) in the Embedded Content section of your file type. Select one of the available options: May Exclude (default), Include, Include With Text, Exclude.
    • Length restrictions - Specify a minimum length and a maximum length.
  5. This option is available only if you work with inline tags. Under Formatting, specify: the size, the color, the position (Inherit, Normal, Superscript, Subscript), and the style (Bold, Italic, Strikethrough, Underline).
  6. This option is available only if you work with structure tags. Under Structure Information:
    1. Select Add new.
    2. Under Properties, select one of the available structure elements from the Name list, and then specify a code, an identifier, a description, color.
    3. Under Formatting, specify: the size, the color, the position (Inherit, Normal, Superscript, Subscript), and the style (Bold, Italic, Strikethrough, Underline).
  7. Select Save.
Add a rule based on an uploaded *.xml file of maximum 1MBParsing rules define how elements are handled. To add a rule:
  1. Select Add New Rule.
  2. Under Rule select either XPath rules, and then select Using rules generation with a dynamic preview. Save the file type and consult the Preview tab populated with the information and default rules from your uploaded *.xml file. In the file preview, you can perform several operations:
    • Hover a start tag and have the end tag highlighted automatically. The rule opens on the right-hand side of the Preview tab, with the default rules pre-populated.
    • Hover a start tag and consult the most important information displayed in a text box displayed inline.
    • Consult the translatable text displayed in bold and the untranslatable text displayed in gray.
    • Continue adding, editing, or deleting the rules, as instructed below.
  3. Under Properties, select and edit the basic settings:
    • Translate: Yes (default), No, Inherit.
    • Tag Type: Structure (default), Inline.
    • Whitespace: Inherit from Parent (default), Always preserve, Always normalize, Normalize unless xml:space='preserve'
  4. Under Properties, select Advanced Settings and edit the following:
    • SID XPATH - Leave the field empty, as this option is only used by WorldServer. For more information about SID, consult the WorldServer documentation.
    • Segmentation Hint - This option is available only if you work with inline tags and only if you specified the extraction rule (segmentation hint) in the Embedded Content section of your file type. Select one of the available options: May Exclude (default), Include, Include With Text, Exclude.
    • Length restrictions - Specify a minimum length and a maximum length.
  5. This option is available only if you work with inline tags. Under Formatting, specify: the size, the color, the position (Inherit, Normal, Superscript, Subscript), and the style (Bold, Italic, Strikethrough, Underline).
  6. This option is available only if you work with structure tags. Under Structure Information:
    1. Select Add new.
    2. Under Properties, select one of the available structure elements from the Name list, and then specify a code, an identifier, a description, color.
    3. Under Formatting, specify: the size, the color, the position (Inherit, Normal, Superscript, Subscript), and the style (Bold, Italic, Strikethrough, Underline).
  7. When finished, select Done and then select Save.

Writer settings

设置说明
Unicode UTF-8 字节顺序标记 (BOM)从列表中选择一个选项,确定在翻译过程中如何处理 BOM:保留;原本没有时不添加保留:原本没有时添加存在时删除
xml:lang 和 lang 属性的值从列表中选择一个选项,确定在翻译过程中如何处理“lang”:将匹配的源语言更改为目标语言始终更改为目标语言不更改

Whitespace settings

设置说明
内容中的非打印字符确定翻译过程中如何处理非打印字符:标准化,xml:space='preserve' 时除外始终保留始终标准化
将标记中的非打印字符标准化选中该复选框后,可确保将标记中的非打印字符标准化。

Namespace settings

设置说明
命名空间解析确定是否要使用命名空间:若在文档中已声明则使用命名空间即使命名空间已声明也始终使用前缀
命名空间为命名空间添加前缀和 URI,然后选择加号

Validation

设置说明
在文件检测时执行 schema 和 DTD 验证确定如何验证 schema 和 DTD 文件:
  • 将所有验证警告视为文件解析错误
  • 在未找到 DTD/架构时报告警告
验证翻译时执行 schema 验证
手动指定 schema启用该选项可手动指定 schema。确定如何使用 schema:
  • 用于所有 XML 文档
  • 仅用于未指定 DTD/schema 的文档
主 schema保留默认值或添加更多文件。
从属性 schema 和 DTD保留默认值或添加更多文件。

Entity settings

设置说明
启用实体转换实体设置用于指定是否将特殊字符转换为其相应的 HTML 实体。根据是否要启用实体转换,选中或清除该复选框。
将数字实体引用转换为内嵌占位符标记根据是否要启用数字实体转换,选中或清除该复选框。
在已锁定内容中跳过转换根据是否要跳过已锁定内容的转换,选中或清除该复选框。
添加实体选择加号、添加字符,并决定是否需要启用以下复选框:
  • 读取为字符 - 启用后,此设置指定在解析过程中哪些实体会转换为各自的字符。
  • 写入为实体 - 启用后,此设置指定在写入过程中哪些字符转换为各自的实体。
编辑实体调整给定的值。

Embedded Content

设置说明
处理内嵌内容 选中该复选框后,系统会支持处理内嵌内容。然后,指定一种处理方法:CDATA 元素内部使用由解析器规则定义由文档结构信息定义
CDATA 元素内部使用CDATA 代表字符数据,指标记为要按字面解释的元素内容的一部分(如文本数据),而不是标记内容的一部分。如果启用该选项,则由该实体解释元素:Embedded Content Plain Text v 1.0.0.0
由解析器规则定义要添加解析器规则:
  1. 请从解析器规则内嵌处理器 ID 列表中,选择一个可用值。
  2. 选择加号
由文档结构信息定义 - 文档结构信息文档结构信息列表中,选择一个可用值,然后选择加号
由文档结构信息定义 - 标记定义规则如果您从上面的文档结构信息列表中选择标记元素,请添加标记定义规则:
  1. 选择添加新规则
  2. 标记类型列表中选择一个值:占位符标记对
  3. 正则表达式字段中,输入正则表达式。
  4. 选中忽略大小写复选框可忽略已识别内容的大小写。否则,保留默认值(清除复选框)。
  5. 断句提示列表中,从列表中选择一个值以确定如何断句:可以排除(默认值)、包含包含文本排除。当您在解析器 > 添加新规则 > 属性 > 高级设置 > 断句提示下配置解析器规则时,此处指定的值可用。查看此主题,了解每个断句提示的作用
  6. 选择保存