The XSD sequence type is normally mapped to an ASN.1 SEQUENCE type. The following items describe special processing that may occur when processing a sequence definition:
If the resulting SEQUENCE type contains only a single repeating element, it is converted into a SEQUENCE OF type. This can occur if either the sequence declaration has a maxOccurs attribute with a value greater than one or if the single element inside has a similar maxOccurs attribute.
If the sequence contains an element that has a ‘minOccurs=“0”’ attribute declaration, the element is mapped to be an OPTIONAL element in the resulting ASN.1 SEQUENCE assignment.
If the sequence contains a repeating element (denoted by having a ‘maxOccurs’ attribute with a value greater than one), then a SEQUENCE OF type for this element is used in the ASN.1 SEQUENCE for the element.
If attributes are defined within the complex type container containing the sequence group, attributes are defined, these attribute declarations are added to the resulting ASN.1 as element declarations as per the X.694 standard. In XML encodings, these appear as attributes in the markup; in binary encodings, they are elements.
Example
<xsd:complexType name="Name"> <xsd:sequence> <xsd:element name="givenName" type="xsd:string "/> <xsd:element name="initial" type="xsd:string" minOccurs="0"/> <xsd:element name="familyName" type="xsd:string"/> </xsd:sequence> </xsd:complexType>
would result in the creation of the following C type definition:
typedef struct EXTERN Name { struct { unsigned initialPresent : 1; } m; const OSUTF8CHAR* givenName; const OSUTF8CHAR* initial; const OSUTF8CHAR* familyName; } Name;