Documentation Center

Restricting element length in XML

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

  1. In the Parser rules for file type XML-Letter, select the <title> element and click Edit.
  2. Under Properties, ensure the tag type is Structure and click Advanced.
  3. 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>
  4. Click OK to close the windows.
  5. In the Options pane, click Verification > QA Checker 3.0 > Length Verification 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.