Tokens are non-editable words or phrases within an expression, specified by the token element in XML. A token has two main properties: its value and its description. The relationship between these properties is similar to the relationship between a property’s name and display name.

The value of a token is a String representing the token’s identity from the application’s point of view. It is specified by an optional value="..." attribute of token. A value need not be supplied in the case of noise words that merely pad out the expression or provide a linguistic handle for a choice. A value should not be localized.

The description of a token is the text used to display the token in the expression editor user interface, both in the body of the actual expression and in choice lists. The description is specified by the text contained in a <description>...</description> child element of token. In general it should be localized. If it is not provided, the token’s value will be used as the description.

The editor text of a token is optional descriptive text that will be displayed in the expression body, but not in choice lists. It is specified by the text contained in a <editor-text>...</editor-text> child element.

A <hidden/> child element, if present, denotes that the token is to be displayed only in choice lists and hidden in the expression body. It is used for choice elements that affect the structure of subsequent parts of the expression, but which would visually disrupt the expression if visible. It is often used for the first element of a sequence that itself is one alternative of a choice.

Some examples:

<token value="1"/>

This example shows a token whose value and description are equal to the string “1”

<token value="US">
  <description>United States</description>

This example shows a token whose value is the ISO country code “US”, and whose description in the user interface is “United States”. In a French locale, the description might be altered to “États-Unis”.

loading table of contents...