xsd:all

The xsd:all type is similar to an ASN.1 SET in that it allows for a series of elements to be specified that can be transmitted in any order. However, due to some technicalities with the type, it is modeled in X.694 to be a SEQUENCE type with a special embedded array called order. This array specifies the order in which XML elements were received if XML decoding of an XML instance was done. If this information were then retransmitted in binary using BER or PER, the order information would be encoded and transmitted followed by the SEQUENCE elements in the declared order. If the data were then serialized back into XML, the order information would be used to put the elements back in the same order in which they were originally received.

The mapping to C type would be the same as for xsd:sequence above with the addition of the special order array. An example of this is as follows:

   <xsd:complexType name="Name">
      <xsd:all>
         <xsd:element name="givenName" type="xsd:string "/>
         <xsd:element name="initial" type="xsd:string"/>
         <xsd:element name="familyName" type="xsd:string"/>
      </xsd:all>
   </xsd:complexType>

would result in the creation of the following C type definition:

   typedef struct EXTERN Name {
      struct {
         OSUINT32 n;
         OSUINT8 elem[3];
      } _order;
      const OSUTF8CHAR* givenName;
      const OSUTF8CHAR* initial;
      const OSUTF8CHAR* familyName;
   } Name;

In this case, the _order element is for the order element described earlier. Normally, the user does not need to deal with this item. When the generated initialization is called for the type (or C++ constructor), the array will be set to indicate elements should be transmitted in the declared order. If XML decoding is done, the contents of the array will be adjusted to indicate the order the elements were received in.