Please keep in mind that in order for the File Type configuration to work correctly, the source XML file *
must* contains an attribute defining the maximum length such as in the example below:
Note: if your file type configuration contains an embedded content processor (i.e. for HTML or Plain Text) and the XML source file contains content processed by the processor such as CDATA content, the length limitation will not be applied to that content. Embedded content which is handled via external processors relies on the external processor functionality. If such a processor doesn't support length limitation, it will not work. Read this article for more details. Example of such setting:
Length Restrictions can be added on the desired element from the file type’s Parser Rules
Custom XML File Types can be configured to detect minimum and maximum character limits by following these steps in Trados Studio_
- Go to File Types and select the relevant XML 2 File Type configuration (or any filter configuration you are using)
- Click the Parser section and select the desired element from the Rules list
- Make sure that the Tag Type is set to Structure or Not specified. Do not set it to Inline Tag Type.
- Click Edit > Advanced
- Following the example above where in the source file the maximum file length is defined by the attribute max, set the Minimum and/or the Maximum Length value under the Length Restrictions section by adding @max as displayed below. Note that the attribute name must reflect the attribute included in the source xml. This is an example where the attribute in the source xml is called max, but in your case it could be called differently, i.e. maxlength.
Note: this type of configuration is available to the
Custom XML (XML 2) File Type, to
the deprecated
Custom XML (Embedded Content Processor) and the
Custom XML (Legacy Embedded Content) File Types.
You cannot add Length restrictions to a built-in XML File Type such as the
Any XML File Type because the parser rules for this XML File Type are auto-generated and cannot be changed or configured.
Moreover, the length restriction will not work in Browser Workbench, but only when exporting a file segmented with the appropriate File Type configuration to a WSXZ package. Running a verification in Studio will then identify the segments where the length restriction has been exceeded.
It is also possible to set a length restriction via
QA Profile. You can learn more about this option - which is independent from the file type configuration - in this article:
WorldServer - How to set the maximum character length of target segments for translation in SDL Trados Studio