You can set length restrictions on elements and translatable attributes. This topic shows how to set length restriction for the <title> element of file type XML-Letter, using the sample XML file example-xml-file-letter.xml. It builds on the example Example: Creating an XML File type, XML-Letter.
Procedure
- In the Parser rules for file type XML-Letter, select the
<title> element and click Edit.
- Under Properties, ensure the tag type is Structure and click Advanced.
- Under Length restrictions, in the Maximum length type @maxlength. Note that in the file
example-xml-file-letter.xml, the @maxlength attribute of <title> is 10:
<title maxlength="10">Quote Letter</title>
- Click OK to close the windows.
- In the Options pane, click from the navigation tree, and then select Check if target segments are within file specific limits and Check length limitation.
In the Editor, open the file example-xml-file-letter.xml. Elements with length restrictions are highlighted in red in the document structure column. Enter a translation for <title> that is more than 10 characters and try to confirm the translation.