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:anyelement 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.
To cast an XML schema base type to a derived type, complete the following steps:
- Select the XML schema base type.
For example, you can cast an
xsd:anyelement to the Address XML schema base type.
- Right-click the XML schema base type (Address),
and then select Cast.
- 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:
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.
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.