Configuring XML Microsoft NET file types
You can configure XML Microsoft NET settings, so that you customize the way this file type is processed during translation or review.
Procedure
- 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.
- Expand the File Types list, and select the XML Microsoft NET filter.
- 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:
Under Do 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
schemaLocationorno NamespaceSchemaLocationattribute 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.
- Select the Parser page, and do one of the following:
- Enable or disable existing parser rules.
- Add parser rules.
- Import parser rules.
- Edit parser rules.
- Remove parser rules.
- Define structure information properties.
- Select the Writer page, and then:
- 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
- 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 toxml:lang="fr-FR"in the target file. - Select Always change to target language, if you want to change
xml:lang="..."in the source file toxml:lang="fr-FR"in the target file. - Select Do not change, if you want to keep the
xml:langattribute values unchanged.
Note: SDL Trados Studio does not support generic language tags for the xml:lang attribute. You need to specify the language and the country subtag (for example, fr-FR). - Select Change matching source language to target language, if you want to change
- 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:
- Select the Entities page, and then select Enable entity conversion to specify whether SDL Trados Studio displays an XML Entity as an entity reference (
>) or as a character (>). - Under Entity conversion, select the checkboxes corresponding to the XML entities for which you want conversion to apply.
- 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).
- Select Advanced, and in the Advanced XML Entity Settings dialog, specify when characters are converted between entity representation and character representation.
- 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.
- 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.
- 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.
- Under Whitespace in tags, select Always normalizeso that SDL Trados Studio replaces any whitespace found in the XML element with a single space.
- Under Whitespace in content, choose one of the options:
- Select the Preview page, to add style sheets which enable SDL Trados Studio to preview your HTML files correctly:
- In the Stylesheet transform: area, select a style sheet.
- In the Additional files: area, select Add to include reference files (CSS, JavaScript or image files) for your style sheet.
- 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.
- 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
- Select Perform schema validation when verifying translation, so that validation takes place during the verification phase in the Editor view.
- 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).
- If you decided to manually specify the schema, in the Master Schemas area, select Add and choose the
*.xsdschemas. - In the Dependecy Schemas and DTDs, select Add and choose
*.xsdor*.dtdschemas which are referenced from a master schema.Note: When you specify a*.dtd, it must be in the same directory as the file. Clear the Manually specify schema checkbox.
- Select Perform schema and DTD validation during file detection, so that validation takes place during the file detection phase.
- Select the Embedded content page.
- Select Process embedded content using the following processor:, to process XML embedded content with one of the available embedded content processors. If you do not enable embedded content processing, SDL Trados Studio treats content embedded in an XML type as plain text.
- Choose an embedded content processor from the list. You can add custom embedded content processors to expand the list of available options.
- Under Process embedded content found in:, select one of the available options.
- Select CDATA sections, to set the selected embedded content processor to extract embedded content from CDATA sections. If you enable this option, SDL Trados Studio identifies and processes CDATA sections automatically, so you do not need to make any further extraction settings.
- Select Document structure, to set the selected embedded content processor to extract embedded content from specific context. Select Add to create extraction rules based on document structure information.
Note: Make sure that the document structure information you specify here is covered by a parser rule on the Parser page of your XML file type. SDL Trados Studio can only extract embedded content that is recognized by the file type parser. Go to the Parser page and make adjustments, if necessary. - Select the QuickInsert page.
- Specify QuickInsert settings to insert tags and formatting, or to insert text and special characters.
- Select OK.