A "repeatable XML Schema element" is an XML Schema item that has the maxOccurs attribute either set to an integer value that is >= 1 or else set to unbounded.
A COBOL table is a COBOL elementary item or group item that includes in its data description either an OCCURS clause (creating a fixed-length table) or an OCCURS DEPENDING ON clause (creating a variable-length table). In IBM® online help, "ODO" is an abbreviation for OCCURS DEPENDING ON.
Thus if the COBOL table occurrence is MY-USER-ENTRY and the corresponding repeatable XML Schema element is MyUserEntry, then MY-USER-ENTRY and MyUserEntry must be isomorphic.
Thus if the object of the ODO clause is NUM-USER-ENTRIES, then you must create a mapping between the COBOL item NUM-USER-ENTRIES and a corresponding XML Schema element (such as an element named NumUserEntries).
Thus if the COBOL table is named USER-ENTRIES and the object of its ODO clause is the item NUM-USER-ENTRIES, then the XML Schema element that you map to NUM-USER-ENTRIES must appear in the .xsd file before the XML Schema element that you map to USER-ENTRIES.
To determine whether a mapping is valid, the XML to COBOL mapping tools make certain assumptions about the maximum number of instances that can occur for a repeatable XML Schema element or for an item in a COBOL table.
For example, the mapping tools allow you to map a repeatable XML Schema element that can repeat as many as 30 times to a COBOL table that can contain a maximum of only 20 elements. (This examples assume that the XML Schema element is isomorphic with the COBOL table item and that the mapping is otherwise valid).
If the conversion program determines that the data cannot be converted (either from XML Schema to COBOL or from COBOL to XML Schema) because the source data contains more elements than are available in the target data structure, then at that time the conversion program returns an error code to the calling program.
| Source data area: | Target data area: | Maximum possible number of repetitions (See Note) | Does the mapping tool permit the mapping? | Runtime results: |
|---|---|---|---|---|
| Repeatable XML Schema element, with maxOccurs set to an integer value. | COBOL table | LESS THAN OR EQUAL TO.
|
The mapping is permitted. | The XML Schema data is converted into occurrences in the COBOL table. |
| Repeatable XML Schema element, with maxOccurs set to an integer value. | COBOL table | GREATER THAN.
|
The mapping is not permitted. |
|
| Repeatable XML Schema element, with maxOccurs= unbounded | COBOL table | The XML Schema element can repeat any number
of times, whereas the COBOL table has a finite maximum number of occurrences.
|
The mapping is permitted. |
|
Note: When you
attempt to do the mapping in the mapping tool, is the maximum possible
number of repetitions of the repeatable XML Schema element LESS THAN
OR EQUAL TO the maximum possible number of items in the COBOL table?
|
||||
| Source data area: | Target data area: | Maximum possible number of repetitions (See Note) | Does the mapping tool permit the mapping? | Runtime results: |
|---|---|---|---|---|
| COBOL table | Repeatable XML Schema element, with maxOccurs set to an integer value. | LESS THAN OR EQUAL TO.
|
The mapping is permitted. | The occurrences in the COBOL table are converted into repetitions of the repeatable XML Schema element. |
| COBOL table | Repeatable XML Schema element, with maxOccurs set to an integer value. | GREATER THAN.
|
The mapping is not permitted. |
|
| COBOL table | Repeatable XML Schema element, with maxOccurs= unbounded | The COBOL table has a finite maximum number
of occurrences, whereas the XML Schema element can repeat any number
of times.
|
The mapping is permitted. |
|
Note: When you
attempt to do the mapping in the mapping tool, is the maximum possible
number of items in the COBOL table LESS THAN OR EQUAL TO the maximum
possible number of repetitions of the repeatable XML Schema element?
|
||||