XML Data Type Mapping(3.0)
XML data types are automatically mapped to data types in Ultra as follows:
XML Type | Ultra Type |
---|---|
<integer types> | int , except for long and unsignedLong . These data types are mapped to bigint . |
float | float |
double | double |
dateTime | date |
anyType | The AnyType UDR. See AnyType UDR Type(3.0). |
<all other types> | string |
The mapping of the data types also depends on the element attribute maxOccurs
. When the value of this attribute is greater than 1 (one) or unbounded
, the mapped field is of list type.
When the element attribute minOccurs
is 0 (zero), the field is considered optional and can be omitted in the internal format.
Declared attributes are considered mandatory or optional, depending on the use
attribute:
required
- The field is mandatory.optional
(default) - The field is optional.prohibited
- The use attribute is ignored and the field is optional.
Example - Mapping of element- and attribute types
element name="REQUEST"> <complexType> <!-- Mapped to string, mandatory --> <attribute name="REQUEST_ID" type="string" use="required"/> <sequence> <!-- Mapped to string, mandatory --> <element name="ITEM" type="string" minOccurs="1" maxOccurs="1"/> <!-- Mapped to list<string>, mandatory --> <element name="A_ITEMS" type="string" minOccurs="1" maxOccurs="2"/> <!-- Mapped to list<string>, mandatory --> <element name="B_ITEMS" type="string" minOccurs="1" maxOccurs="unbounded"/> <!--Mapped to string, optional-> <element name="C_ITEMS" type="string" minOccurs="0" maxOccurs="1"/> </sequence> </complexType> </element>
, multiple selections available,