Hide Comments

The simpleType element defines a data type based on either a Built-in Primitive Type, a User-defined Primitive Type or on another Simple Type. Simple Types MAY be defined with or without Constraints. When defined without Constraints they simply provide an additional layer of meaning over the underlying primitive type.

Syntax

simpleType <simpletype-name> [~defined] as (<built-in-primitive-type> | <user-defined-primitive-type> | <simple-type>)

[<constraint-spec>]...

Examples

// Based on Built-in string type.

simpleType SocialSecurityNumber defined as string

matching regex '(?!000|666)[0-8][0-9]{2}-(?!00)[0-9]{2}-(?!0000)[0-9]{4}'

// Based on Built-in integer type.

simpleType DayOfYear1 as integer

valueRange from '1' to '366'

// Based on Built-in integer type.

simpleType DayOfYear defined as integer

with valueRange from minimum '1' up to maximum '366' inclusive

// Based on Built-in integer type.

simpleType WholesaleQuantity as integer

with valueRange from minimum '1000'

// Based on Built-in decimal type.

simpleType FractionalValue as decimal

with valueRange from '0' exclusive up to '1' exclusive

// Based on Built-in integer type.

simpleType NoMoreThan12 defined as integer

valueRange up to '12'

// Based on another Simple Type.

simpleType ChildTravelerAge defined as NoMoreThan12

Parameters

Field Name

Type

Description

<simpletype-name>

Name

The Name assigned to this user-defined type.

<built-in-primitive-type>

SName(Built-in Primitive Type)

The Name of a Built-in Primitive Type from which this type is derived.

<user-defined-primitive-type>

QName(Primitive Type)

The QName of a User-defined Primitive Type from which this type is derived.

<simple-type>

QName(Simple Type)

The QName of another Simple Type from which this type is derived.

Child Elements

Name

Topic

Description

<constraint-spec>

Constraints

One or more Constraint specifications.

Parent Elements

Data Model

Discussion

A Primitive Property MAY specify a user-defined Simple Type as data type of the property.

A Simple Type may also derive from another Simple Type.  Circular dependencies in the Simple Type derivation graph are disallowed, and processors SHOULD guard against such cycles.

A Simple Type MAY NOT be used as the data type of a URI parameter or Method parameter.

Created with Help & Manual 6 and styled with Premium Pack Version 2.51 © by EC Software