配置 XML Author-it 文件类型

您可以配置 XML Author-it 设置,以便自定义在翻译或审校期间处理这种文件类型的方式。

过程

  1. Decide for which projects you want to configure file type settings:
    • For the active project, go to the Projects view, and on the Home tab, select Project Settings.
    • For all future projects, go to File > Options.
  2. 展开文件类型列表,然后选择符合 XML Author-it 筛选条件。
  3. Select the Detection page, to specify the settings which will match the content of the file with its file type. Use any combination of the following XML items to identify a file type:
    UnderDo the following
    Any of the following root elements

    Select Add ..., and enter one or more names used for the root element, for example my_root.

    xsi:schemaLocation declaration containing the following URI:

    Type the URL used to specify the schema location. This matches schemaLocation or no NamespaceSchemaLocation attribute in the file.

    DOCTYPE declaration

    Type the element name.

    For example:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

    xmlns: declaration with any of the following URIs:

    Select Add ..., and enter one or more namespace URLs.

    Any of the following XPath rule matches:

    Select Add ..., and enter one or more XPath rules.

  4. Select the Parser page, and then:
    1. Under String value extraction, choose one of the options:
      • Extract all string, to extract all string values that contain a key.
      • Specify rules for extracting, to extract values (numbers, boolean, strings, date time) from specific file paths. If the source file has no value, then that empty value becomes undefined in the target file.
    2. If you choose Specify rules for extracting (under String value extraction), select Add. In the Add JSON Path dialog, type a path, choose a value from the Document Structure Information list, and then select OK.
  5. Select the Writer page, and then:
    1. Under Unicode UTF-8 byte order mark (BOM), choose when the SDL file support software should insert a UTF-8 BOM in the target file:
      • Preserve: don't add if not originally present
      • Preserve: add if not originally present
      • Remove if present
    2. Under xml:lang attribute values:
      • Select Change matching source language to target language, if you want to change xml:lang="en-US" in the source file to xml:lang="fr-FR" in the target file.
      • Select Always change to target language, if you want to change xml:lang="..." in the source file to xml:lang="fr-FR" in the target file.
      • Select Do not change, if you want to keep the xml:lang attribute values unchanged.
  6. Select the Entities page, and then select Enable entity conversion to specify whether SDL Trados Studio displays an XML Entity as an entity reference (&gt;) or as a character (>).
  7. Under Entity conversion, select the checkboxes corresponding to the XML entities for which you want conversion to apply.
    1. Select the checkboxes corresponding to the XML entity sets for which you want conversion to apply. Entities can be of the Default (the entities are the standard entity mappings from W3C) or of the Custom type (the entity set was changed).
    2. Select Advanced, and in the Advanced XML Entity Settings dialog, specify when characters are converted between entity representation and character representation.
  8. Under Entity mappings, consult the entities in the entity set selected under Entity conversion, and, if necessary, you can add, edit or remove entity mappings.
  9. Select the Namespaces page, to provide namespace declarations for an XML file type.
    1. Under Namespace resolution: use one of the following options:
      • Select Use namespace when declared in the document, when a namespace declaration in the file defines a prefix.
      • Select Always use prefix even when a namespace is declared, when a namespace declaration in the file type settings (that is, on this page) defines a prefix.
    2. Under Namespaces: consult the prefix and the URI for the available namespaces, and select Add to add namespace entries.
  10. Select the Whitespace page, to specify how SDL Trados Studio deals with whitespace characters (spaces, non-breaking spaces, tabs, line breaks) in the elements of an XML file.
    1. Under Whitespace in content, choose one of the options:
      • Select Always preserve, so that SDL Trados Studio does not replace any whitespace found in the XML element with a single space.
      • Select Normalize unless xml:space='preserve', so that SDL Trados Studio replaces only the whitespace which is not tagged with the attribute xml:space='preserve'.
      • Select Always normalize, so that SDL Trados Studio replaces any whitespace found in the XML element with a single space, ignoring any xml:space='preserve' attribute.
    2. Under Whitespace in tags, select Always normalizeso that SDL Trados Studio replaces any whitespace found in the XML element with a single space.
  11. Select the Preview page, to add style sheets which enable SDL Trados Studio to preview your HTML files correctly:
    1. In the Stylesheet transform: area, select a style sheet.
    2. In the Additional files: area, select Add to include reference files (CSS, JavaScript or image files) for your style sheet.
  12. Select the Validation page, to specify the settings which ensure that the structure and content of the XML file matches the specifications given by the DTD or schema.
    1. Select Perform schema and DTD validation during file detection, so that validation takes place during the file detection phase.
      • If you select Treat all validation warnings as file parsing errors, and there are validation warnings, SDL Trados Studio will not open the file.
      • Select Report warning if no DTD/schema can be found
    2. Select Perform schema validation when verifying translation, so that validation takes place during the verification phase in the Editor view.
    3. Select Manually specify schema, if you want manually specified schemas to override the schemas referenced in the file, and then decide whether you want to use the manual schemas for all XML files (Use for all XML documents) or only for XML files with an unspecified DTD/schema (Use only for XML documents which don't specify DTD/schema).
    4. If you decided to manually specify the schema, in the Master Schemas area, select Add and choose the *.xsd schemas.
    5. In the Dependecy Schemas and DTDs, select Add and choose *.xsd or *.dtd schemas which are referenced from a master schema.
  13. Select the Embedded content page.
  14. Select Enable embedded content processing.
  15. In the Document structure information area, select Add to create extraction rules based on document structure information.
  16. In the Tag definition rules area, select Add to specify the tags which will be processed and to define them as translatable or non-translatable.
  17. Select the QuickInsert page.
  18. Specify QuickInsert settings to insert tags and formatting, or to insert text and special characters.
  19. 选择确定