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.
- Characters other than A-Z, a-z, 0-9, or _ are replaced with '
X
'.
For example, monthly-total becomes monthlyXtotal.
- If the first character is not an alphabetic character, it is
replaced
by a leading '
X
'.
For example, _monthlysummary becomes Xmonthlysummary.
- 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 year become year and year1.
- Five characters are reserved for the strings
_cont
or
_num
,
which are used when the schema specifies that the variable has varying
cardinality; that is, when
minOccurs
and
maxOccurs
are
specified on an
xsd: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
_value
or
_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, but nil_ 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.
- 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:
char[255] |
where
type
is one
of:
|
All mapping levels:
char[ |
where
type
is
one of:
|
When
CCSID=1200
at mapping
level 4.0 and higher:
char16_t[ |
where
type
is one
of:
|
All mapping levels:
char[32] |
|
Mapping level 1.2 and below:
char[32] Mapping
level 2.0 and higher:
char[40] Mapping level 3.0 and higher: char[8] The format of the time stamp is CICS ABSTIME. |
|
All mapping levels:
signed char |
|
All mapping levels:
char |
|
All mapping levels:
short |
|
All mapping levels:
unsigned short |
|
All mapping levels:
char[33] |
|
All mapping levels:
int |
|
All mapping levels:
unsigned int |
|
All mapping levels:
long long |
|
All mapping levels:
unsigned long long |
|
All mapping levels:
bool |
|
Mapping level 1.0:
Not supported Mapping
level 1.1 and higher:
char[255] |
|
Mapping level 1.0:
Not supported Mapping
level 1.1 and higher:
char[255] |
where the length is not defined
|
Mapping level 1.1 and below:
char[ Mapping level 1.2 and higher:
char[
char[16] |
|
Mapping level 1.1 and below:
char[32] Mapping
level 1.2 and higher:
float(*) 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:
char[32] Mapping
level 1.2 and higher:
double(*) 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.
|