XML schema to C and C++ mapping
The DFHSC2LS and DFHWS2LS utility programs support mappings between the XML schema definitions that are included in each web service description and C and C++ data types.
How XML schema element names are converted to C and C++
The CICS® assistants generate unique and valid names for C and C++ variables from the schema element names using the following rules:
- Characters other than A-Z, a-z, 0-9, or _ are replaced with '
X'.For example,
monthly-totalbecomesmonthlyXtotal. - If the first character is not an alphabetic character, it is replaced by a leading '
X'.For example,
_monthlysummarybecomesXmonthlysummary. - If the schema element name is longer than 50 characters, it is truncated to that length.
- Duplicate names in the same scope are made unique by the addition of one or more numeric
digits.
For example, two instances of
yearbecomeyearandyear1. - Five characters are reserved for the strings
_contor_num, which are used when the schema specifies that the variable has varying cardinality; that is, whenminOccursandmaxOccursare specified on anxsd:element.For more information, see Variable arrays of elements.
- For attributes, the previous rules are applied to the element name. The prefix
attr_is added to the element name, and it is followed by_valueor_exist. If the total length is longer than 28 characters, the element name is truncated.The nillable attribute has special rules. The prefix
attr_is added, butnil_is also added to the beginning of the element name. The element name is followed by_value. If the total length is longer than 28 characters, the element name is truncated.
The total length of the resulting name is 57 characters or less.
How XML schema types are mapped to C and C++
- If the MAPPING-LEVEL parameter is set to 1.2 or higher and the CHAR-VARYING parameter is set to NULL, variable-length character data is mapped to null-terminated strings and an extra character is allocated for the null-terminator.
- If the MAPPING-LEVEL parameter is set to 1.2 or higher and the CHAR-VARYING parameter is set to YES, variable-length character data is mapped to two related elements: a length field and a data field.
| Schema simpleType | C and C++ data type |
|---|---|
|
Mapping level 2.0 and below: Not supported Mapping level 2.1 and higher: Supported |
|
Mapping level 1.0: Not supported Mapping level 1.1 and higher:
|
where type is one of:
|
All mapping levels:
|
where type is one of:
|
When CCSID=1200 at mapping level 4.0 and higher:
|
where type is one of:
|
All mapping levels:
|
|
Mapping level 1.2 and below:
Mapping level 2.0 and higher:
Mapping level 3.0 and higher:
The format of the time stamp is CICS ABSTIME. |
|
All mapping levels:
|
|
All mapping levels:
|
|
All mapping levels:
|
|
All mapping levels:
|
|
All mapping levels:
|
|
All mapping levels:
|
|
All mapping levels:
|
|
All mapping levels:
|
|
All mapping levels:
|
|
All mapping levels:
(C++ only)
(C only) |
|
Mapping level 1.0: Not supported Mapping level 1.1 and higher:
|
|
Mapping level 1.0: Not supported Mapping level 1.1 and higher:
|
where the length is not defined |
Mapping level 1.1 and below:
where
y =4×(ceil( z /3)). ceil( x ) is the
smallest integer greater than or equal to x. Mapping level 1.2 and higher:
where the length
is fixed.
is the name of the container that stores the binary data when the length is not defined. |
|
Mapping level 1.1 and below:
Mapping level 1.2 and higher:
Note: The IBM® Hexadecimal Floating Point (HFP) data representation is not exactly the same as the IEEE-754-1985 representation that is used for XML. Some values might not convert exactly from one representation to the other. Some extremely large or small values might not be valid for
xsd:float data types. Some values might lose precision when converted to
or from HFP representation. If precise conversions are important, consider replacing use of float
data types with fixed precision alternatives. |
|
Mapping level 1.0 and below:
Mapping level 1.2 and higher:
Note: The IBM Hexadecimal Floating Point (HFP) data representation is not exactly the same as the IEEE-754-1985 representation that is used for XML. Some values might not convert exactly from one representation to the other. Some extremely large or small values might not be valid for
xsd:double data types. Some values might lose precision when converted to
or from HFP representation. If precise conversions are important, consider replacing use of double
data types with fixed precision alternatives. |