Simple Types

A simple type is a structure that represents a simple value only.

Simple types are data structures like strings, numbers, and booleans. They can also be customized with facets so that only a certain range of numbers, or a certain set of codes, for example, are allowed.

Simple types can be used in two ways in the model:

  • Core defines attribute personNameInitialIndicator. Its type is a boolean - a simple type.
  • Core defines simple type AddressCategoryCodeSimpleType, which constrains a string down to a few possible codes, like residential and business.

Provided types

Common simple types provided by XML include xs:string, xs:token, xs:date, xs:date-time, xs:integer, xs:decimal, and xs:boolean.

Simple types provided by JSON are string, integer, decimal, and boolean. Dates are simply strings in JSON, but if they follow the format set by ISO 8601, they can be converted into dates in JavaScript.

Other kinds

In addition to a simple type with facets, NIEM supports two additional kinds of simple types:

  • List Types
    A list type is a simple type that allows for values to be repeated, separated by a space.
  • Union Types
    A union type is a simple type that represents the combined set of allowable values from other simple types.