Complex Global Type Re-use

To use a complex global type as is, in another location in the schema tree, begin by inserting a new Record node at the desired location. Then set its Data Structure Type property to the name of a complex global type.

In the following example, BillingAddress is the name of the newly inserted Record node, and GlobalAddrType is the name of the complex global type that it adopts. In the schema tree view, a duplicate node structure would be displayed below the node named BillingAddress, identical to the adjacent node structure under the node named ShippingAddress.

  • Before, with a newly inserted node named BillingAddress.

    <xs:schema>  
        <xs:element name="Root">  
            <xs:complexType>  
                <xs:sequence>  
                    <xs:element name="ShippingAddress" type="GlobalAddrType" />  
                    <xs:element name="BillingAddress">  
                        <xs:sequence />  
                    </xs:element>  
                </xs:sequence>  
            </xs:complexType>  
        </xs:element>  
        <xs:complexType name="GlobalAddrType">  
        [Address structure defined globally here.]  
        </xs:complexType>  
    </xs:schema>  
    
  • After using the complex base type GlobalAddrType, as is.

    <xs:schema>  
        <xs:element name="Root">  
            <xs:complexType>  
                <xs:sequence>  
                    <xs:element name="ShippingAddress" type="GlobalAddrType" />  
                    <xs:element name="BillingAddress" type="GlobalAddrType" />  
                </xs:sequence>  
            </xs:complexType>  
        </xs:element>  
        <xs:complexType name="GlobalAddrType">  
        [Address structure defined globally here.]  
        </xs:complexType>  
    </xs:schema>  
    

See Also

Ways to Use Complex Global Types