In an automatic group mapping, groups of XML elements (user-defined complex
types) can be mapped to groups of COBOL elementary items (COBOL group items).
If you create a mapping between an XML complex type and a COBOL group item
in an request session, the child elements of the XML
complex types will be automatically matched to the subordinate COBOL items.
For the response session, you can map
COBOL groups to XML complex types in a similar way. You cannot use automatic
group mapping on groups that have any elementary items that are already mapped.
You can invoke the automatic group mapping function by selecting the source
and the target elements and then clicking the Map the matching
elements icon in the Mapping Editor
For automatic group mappings, the structure of COBOL group items must be
compatible with the structure of XML complex types. Mapped groups are considered
structurally compatible if the following conditions are met:
- The XML instance document and the COBOL language structure it is being
mapped to meet the following requirements:
- A composed element is an element containing other elements. Each
composed element of the XML instance document starting from the root has one
and only one corresponding COBOL group item whose nesting depth is identical
to the nesting depth of its XML equivalent.
- A non-composed element is an element that does not contain other
elements. Each non-composed element in the XML instance document starting
from the top has one and only one corresponding COBOL elementary item whose
nesting depth is identical to the nesting level of its XML equivalent and
whose memory address at run time can be uniquely identified.
- For the request mapping, the innermost complex
type contains at least one simple type compatible in type with that of its
COBOL mapped item.
- For the response mapping, every XML complex type
must contain the same number of simple types compatible with that of their
COBOL mapped items.
- The mapped COBOL group does not contain subordinate redefining items.
(The mapped group itself can be a redefining item)
- The mapped COBOL group does not contain OCCURS DEPENDING ON constructs.
Automatic group mappings are always one-to-one.
Top-level mapping
When you create the mapping session
file, the top-level object shown on the XML side is an XML node associated
with the source or target XML document. The top-level COBOL object on the
COBOL side is the COBOL file containing level 01 language structure that you
selected in the Mapping session wizard.