Message model objects: simple types

A simple type is an abstract definition of an item of data such as a number, a string or a date.

The purpose of a simple type is to define the content of one or more simple elements. Simple types (and any elements based on them) cannot contain attributes or child elements. Simple types stand in contrast to complex types, which define the structure of an element but usually do not define any simple data.

Global and local simple types

Simple types can be global or local. A global simple type can be used as the basis for more than one element. It must be given a unique name by which it can be referenced. A local simple type is associated with a single element, and is not available for reuse elsewhere in the message model. Local types do not need a name, and are displayed as {Local simpleType} by the message definition editor.

Variations of simple types

Restriction

A simple type can be derived from another simple type (the base type) by restriction. A restriction type can have value constraints applied to it.

A restriction type may be defined as a built-in simple type, a user defined simple type or a local simple type defined anonymously within the restriction.

List

A list type is a way of rendering a repeating simple value. The notation is more compact than the notation for a repeating element, and offers a way to have multi-valued attributes.

A list type can be based on a union type. This can describe a space-separated list of items in which each item can be based on any of the simple types in the union.

A list of lists is not legal. The item type of a list cannot be a list itself or derived at any level from another list type and will result in a task list error in the editor.

A list type can have the facets of minLength, maxLength and length applied to it. These facets restrict the number of items in the list. To restrict the values of each item in the list, facets should be applied to the item type and not the list itself. The message definition editor provides additional support for enumeration and pattern facets directly on a List type, to enable the import of any schema using them, but will issue a warning that enumeration and pattern facets will be ignored by the Broker.

Union

A union type is as a union of two or more other simple types.

A union type allows a value to conform to any one of several different simple types. The simple types that compose a union type are known as its member types. There is no upper limit on how many member types may exist, but there must be at least one. A member type may be defined as a built-in simple type, a user defined simple type or a local simple type defined anonymously within the union type.

A union type can also include list, union and restricted simple types among its members.

The broker does not apply value constraints until the data is in the logical tree. This means it will not be possible to choose between two simple types which are derived from the same fundamental type, but with different constraints (for example, integer with range 1-10 and integer with range 11-20). A warning will appear in the task list if this is attempted and the broker will simply ignore the constraints when resolving the union. The message definition editor provides additional support for enumeration and pattern facets directly on a Union type, to enable the import of any schema using them, but will issue a warning that enumeration and pattern facets will be ignored by the broker.

Value constraints

Any value constraints applied to the derived type must further restrict the base type (and any elements based on it). It is illegal for a derived type to weaken or remove a value constraint which its base type has defined. If no value constraints are applied to the derived type, it will be almost identical to its base type, although it will be treated as a restriction of the base type in situations where that is relevant (type inheritance and element substitution).