Skip Headers

# Mapping a Union of Unions

Previous

Next

Use an `EISDirectMapping` (with XML records) or an `XMLDirectMapping` to map a Java attribute to an `xsd:union` that contains `xsd:union` types, such as:

    <xsd:simpleType name="UnionOfUnions">
        <xsd:union>
            <xsd:simpleType>
                <xsd:union>
                  <xsd:simpleType>
                    <xsd:list itemType="xsd:date"/>
                  </xsd:simpleType>
                  <xsd:simpleType>
                    <xsd:list itemType="xsd:integer"/>
                  </xsd:simpleType>
                  </xsd:union>
          </xsd:simpleType>
          <xsd:simpleType>
                <xsd:union>
                  <xsd:simpleType>
                    <xsd:list itemType="xsd:string"/>
                  </xsd:simpleType>
                  <xsd:simpleType>
                    <xsd:list itemType="xsd:float"/>
                  </xsd:simpleType>
                  </xsd:union>
          </xsd:simpleType>
        </xsd:union>
    </xsd:simpleType>

Note that in this example, valid XML documents may contain any of `xsd:date`, `xsd:integer`, `xsd:string`, or `xsd:float`.

For more information, see "Mapping to a Union of Unions With an XML Direct Mapping". The same applies to an `EISDirectMapping` with XML records (see "EIS Direct Mapping").