IBM Integration Bus, Version 10.0.0.0 Operating Systems: AIX, HP-Itanium, Linux, Solaris, Windows, z/OS


Advanced XML schema structures valid in input and output messages

You can use several advanced schema structures in graphical data maps.

You can use any of the following XML features in message models that are defined as inputs or outputs to the Graphical Data Mapping editor:

Substitution groups

A substitution group is an XML schema feature that provides a means of substituting one element for another in an XML message.
  • The element that can be substituted is called the head element.
  • The substitution group is the list of elements that can be used in its place.

The head element and any mapped substitutions are shown by default in the Graphical Data Mapping editor. The mapped substitutions are listed beneath the head element.

You create mappings to or from members of substitution groups in the same way as you map other elements.

Wildcards (xsd:any)

You can use wildcards to create open content models. You can define xsd:any and xsd:anyAttribute wildcards.

Wildcards are characterized for the following attributes:
  • The namespace attribute: You can use this attribute to specify the namespace that the elements or attributes that match the wildcard can come from.
  • The processContents attribute: You can use this attribute to specify how the XML content matched by the wildcard is validated.
When you use wildcards in the Graphical Data Mapping editor, you must consider the following behavior:
  • You can wire a xs:any or a xs:anyAttribute as the input or output of a Submap transform. Then, when you configure the Submap transform, you can define that input or output to be a particular type.
  • A wildcard element can be instantiated only with another element.
  • A wildcard attribute can be instantiated only with another attribute.
  • You can use a global element or attribute as a wildcard replacement.

For more information, see Mapping xsd:any on an input or output message.

Derived types

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

In a message map, you can cast a base type to a derived type or extension type. You can define transformations between subtypes of a data type.

When you use derived types in the Graphical Data Mapping editor, you must consider the following behavior:
  • For an element of a specific type, the base type and the mapped derived types are shown by default. All attributes and elements of the base and derived types are displayed.
  • You create mappings to or from a derived type and its elements in the same way that you map any base type and its elements.
  • When you map an input element to an output element with a derived schema type or an extension schema type, the created output element is set with the relevant xsi:type attribute for that schema type.

List types (xs:list)

You can use xs:list to define a simple type element as a list of values of a specified data type. For example:

<xs:simpleType name='CustomerName'>
	<xs:list itemType='string'/>
</xs:simpleType>
When you use xs:list in the Graphical Data Mapping editor, you must consider the following behavior:
  • You map a simple type element that is defined as a list of values in the same way that you would map any other simple type attribute or element.

Union types (xs:union)

You can use xs:union to define a simple type as a collection of values from specified simple data types. It allows a value to conform to any one of several different simple types. For example:

<xs:element name="zipUnion">
	<xs:simpleType>
		<xs:union memberTypes="USStateName StateID"/>
	</xs:simpleType>
</xs:element>
<xs:element name="USStateName">
  <xs:simpleType>
    <xs:restriction base="xs:string">
      <xs:minInclusive value="0"/>
      <xs:maxInclusive value="100"/>
    </xs:restriction>
  </xs:simpleType>
</xs:element> 
<xs:element name="StateID">
  <xs:simpleType>
    <xs:restriction base="xs:integer">
      <xs:minInclusive value="0"/>
      <xs:maxInclusive value="100"/>
    </xs:restriction>
  </xs:simpleType>
</xs:element> 
When you use xs:union in the Graphical Data Mapping editor, you must consider the following behavior:
  • You map a simple type element that is defined as a collection of values in the same way that you would map any other simple type attribute or element.
  • You must check that the value of an element is processed with the correct type when you use an element that is defined with a union type.
    For example, you can use the expression $zipUnion != '' to check that the value of the element zipUnion is not an empty string. The Graphical Data Mapping editor might fail at run time with BIP3949E if the element zipUnion is not of string type.
    BIP3949E: An error occurred during the processing of a message. 
    To prevent this error, you can explicitly define the type of the element by using the xs:string() function:
    xs:string($zipUnion) != ''
    For more information, see Cast type (xs:type).

cm28857_.htm | Last updated 2015-03-27 19:28:46