XML schema to PL/I mapping
The DFHSC2LS and DFHWS2LS utility programs support mappings between XML schema definitions and PL/I data structures. Because the Enterprise PL/I compiler and older PL/I compilers differ, two language options are supported: PLI-ENTERPRISE and PLI-OTHER.
Rules for mapping schema element names to PL/I
-
Characters other than A-Z, a-z, 0-9, @, #, _, or $ are replaced
with '
X
'.For example,
monthly-total
becomesmonthlyXtotal
.You can use the MAPPING-OVERRIDES parameter to change the way other characters are handled. For example, if you set the value HYPHENS-AS-UNDERSCORES , any hyphen in the XML is converted to an underscore instead of an X. For example,
monthly-total
becomesmonthly_total
. -
If the schema specifies that the variable has varying cardinality
(that is,
minOccurs
andmaxOccurs
attributes are specified with different values on thexsd:element
), and the schema element name is longer than 24 characters, it is truncated to that length.If the schema specifies that the variable has fixed cardinality and the schema element name is longer than 29 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
to the second and subsequent instances of the name.
For example, three instances of
year
becomeyear
,year1
, andyear2
.Should the above behavior be undesirable the user can specify
MAPPING-OVERRIDES=NO-ARRAY-NAME-INDEXING
as input to the utility which disables the addition of one or two numeric digits to the second and subsequent instances of the name. -
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, whenminOccurs
andmaxOccurs
attributes are specified with different values.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 is followed by-value
or-exist
. If the total length is longer than 28 characters, the element name is truncated. For more information, see Support for XML attributes.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 31 characters or less.
Rules for mapping schema types to PL/I
- 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 not specified, by default variable-length character data is mapped to a VARYINGZ data type for Enterprise PL/I and VARYING data type for Other PL/I.
- Variable-length binary data is mapped to a VARYING data type if it less than 32 768 bytes and to a container if it is more than 32 768 bytes.
Schema | PL/I data description |
---|---|
|
Mapping level 2.0 and below: Not supported
Mapping level 2.1 and higher: Supported
|
|
Mapping level 1.1 and higher: CHAR(255)
|
where type is one of:
|
All mapping levels:
CHARACTER(
z
)
|
where type is one of:
|
When CCSID=1200 at mapping level 4.0 and higher:
|
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: FIXED DECIMAL(15) |
|
Mapping level 1.1 and below:
Mapping levels 1.2 and higher:
|
|
All mapping levels:
|
|
All mapping levels:
|
|
All mapping levels:
|
|
All mapping levels:
|
|
All mapping levels:
|
|
All mapping levels:
|
|
All
mapping levels:
|
|
Mapping level 1.1 and below:
Mapping level 1.2 and higher:
All mapping levels:
|
|
Mapping level 1.1 and below:
Mapping level 1.2 and higher:
All mapping levels:
|
|
Mapping level 1.1 and below:
Mapping level 1.2 and higher:
BIT(7)
is provided for alignment
and
BIT(1)
contains the Boolean mapped value.
|
|
All mapping levels:
FIXED DECIMAL(
n
,
m
)
|
|
All mapping levels: CHAR(255)
|
|
All mapping levels: CHAR(255)
|
where the length is not defined |
Mapping level 1.0: Not supported
Mapping level 1.1:
Mapping level 1.2 and higher:
CHAR(16) |
|
Mapping levels 1.0 and 1.1: CHAR(32)
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 DECIMAL FLOAT data types with fixed precision alternatives.
|
|
Mapping levels 1.0 and 1.1: CHAR(32)
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 DECIMAL FLOAT data types with fixed precision alternatives.
|