Casting an XML schema base type to a derived type or extension type

In a message map, you can cast an XML schema base type to a derived type or extension type so that you can define transformations between subtypes of a data type.

Before you begin

  • Model the schemas that correspond to the XML schema base type and the derived type.
  • Cast an xsd:any element in your message map to an XML schema base type.

About this task

A derived type is a data type that is related to another data type known as the base type or super type.

For example, Address is the XML schema base type, and USAddress, CanadianAddress, and UKAddress are derived types of Address.

Procedure

To cast an XML schema base type to a derived type, complete the following steps:

  1. Select the XML schema base type.

    For example, you can cast an xsd:any element to the Address XML schema base type.

  2. Right-click the XML schema base type (Address), and then select Cast.

    This figure shows graphically how to cast a derived type Address. Right-click Address, and then select Cast.

  3. In the Type Selection window, choose a matching type, and then select OK.

    The options available correspond to specific address types in the schema model that are modeled by using Address as the XML schema base type.

    The following figure shows the Type Selection window that you get:

    This figure shows the Type Selection window that opens when you select Cast....

Results

The message map contains two entries, one for the XML schema base type and a second one for the derived type.

In the example, one entry corresponds to the XML schema base type Address. The other entry corresponds to an Address with the derived type CanadianAddress.

This figure shows the message map with two entries for Address, one with an XML schema base type, and one with a CanadianAddress derived type.

What to do next

Define additional transformations between elements in the message map. For more information, see Transform types in the Graphical Data Mapping editor.