enumeration element
- Topics:
- Schema Extension
Content model
enumeration:==(help| value)
Attributes
- @basetype (string)
- @default (string)
- @desc (string)
- @label (string)
- @name (string)
- @template (string)
Parents
<srcschema>
Children
<help>
<value>
Description
This element enables us to define a value enumeration. An enumeration belongs to the schema which it is defined in, but it is accessible via another schema.
Use and context of use
Enumerations are defined at the start of a schema (before the main element is defined).
Attribute description
-
basetype (string): type of the values stored in the enumeration.
List of available types:
- ANY
- bin
- blob
- boolean
- byte
- CDATA
- datetime
- datetimetz
- datetimenotz
- date
- DOMDocument
- DOMElement
- double
- enum
- float
- html
- int64
- link
- long
- memo
- MNTOKEN
- percent
- primarykey
- short
- string
- time
- timespan
- uuid
-
default (string): Default value. The default value may also be one of the values defined in the enumeration.
-
desc (string): enumeration description.
-
label (string): enumeration label.
-
name (string): internal name of the enumeration.
-
template (string): this attribute defines a reference to an
<enumeration>
element shared by several schemas. The definition is automatically copied into the current schema.
Examples
Example of enumeration values whose values are stored in the database:
<enumeration name="myEnum">
<value name="One" value="1"/>
<value name="Two" value="2"/>
</enumeration>
<element label="Sample" name="Sample">
<attribute dbEnum="myEnum" length="100" name="Number" required="true" type="string"/>
</element>
Definition of an enumeration with a default value:
<enumeration basetype="byte" default="email" name="canal">
<value label="Email" name="email" value="0"/>
<value label="Téléphone" name="phone" value="1"/>
<value label="Call Center" name="callcenter" value="2"/>
</enumeration>