From W3C Wiki
Jump to: navigation, search

ITS WG Collaborative editing page

Follow the conventions for editing this page.

Status: Working Draft (Req Doc)

This item is a generalization of the "Indicator of Container Size" requirement started here: [1].

Author: Yves Savourel Type: Spec, requires scope

Indicator of Constraints


[R001] It should be possible to associate one or more constraints to specific content


Translatable data may come with various constraints in the way they can be modified. For example, the content of the following <string> element must accommodate the length restriction imposed by the small display panel where it is used:

Length restriction

<!-- LED display has only 16 characters -->
<string id="s123">Printing...</string>

In this case a standard method should be used for indicating the dimensions of the container so that localization tools can automatically recognize them and, when possible, enforce the constraint during translation.

Examples of constraints are:

  • Container size (e.g. maximum length, etc.)
  • Text allowed in a limited set of characters (e.g. translatable paths or filenames)

These constraints may need to be defined at the schema level or they may need to be defined for specific instances of an element.

In some cases, the constraint may be applicable only for a given context or a given tool.


XSD (XML Schema Part 2: Datatypes Second Edition) provides a mechanism to define "Constraining Facets" ([XSD][2], section 4.3) that may provide some solution for this requirement at the schema level. At the instance level, Schematron [Schematron][3] could be used for the same purpose.

Sometimes the constraint may need to be expressed using units different from the unit used in the document. For example, the maximum length of a string may need to be expressed in byte or pixels, or display cells instead of characters. This may lead to the need for quite a few parameters with the constraint (e.g. the encoding to use, or the font and point-size information, etc.)