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

The CICS® assistants generate unique and valid names for PL/I variables from the schema element names using the following rules:
  1. Characters other than A-Z, a-z, 0-9, @, #, _, or $ are replaced with ' X '.

    For example, monthly-total becomes monthlyXtotal.

    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 becomes monthly_total.

  2. If the schema specifies that the variable has varying cardinality (that is, minOccurs and maxOccurs attributes are specified with different values on the xsd: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.

  3. 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 become year , year1 , and year2.

    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.

  4. 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 attributes are specified with different values.

    For more information, see Variable arrays of elements.

  5. 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, 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.

The total length of the resulting name is 31 characters or less.

Rules for mapping schema types to PL/I

DFHSC2LS and DFHWS2LS map schema types to PL/I data types according to the following table. Also note the following points:
  • 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
<xsd:simpleType>
  <xsd:restriction base="xsd:anyType">
  </xsd:restriction>
</xsd:simpleType>

Mapping level 2.0 and below:

Not supported

Mapping level 2.1 and higher:

Supported

<xsd:simpleType>
  <xsd:restriction base="xsd:anySimpletype">
  </xsd:restriction>
</xsd:simpleType>

Mapping level 1.1 and higher:

CHAR(255)

<xsd:simpleType>
  <xsd:restriction base="xsd:type">
    <xsd:maxLength value="z"/>
    <xsd:whiteSpace value="preserve"/>
  </xsd:restriction>
</xsd:simpleType>
where type is one of:
  • string
  • normalizedString
  • token
  • Name
  • NMTOKEN
  • language
  • NCName
  • ID
  • IDREF
  • ENTITY

All mapping levels:

CHARACTER( z )

<xsd:simpleType>
  <xsd:restriction base="xsd:type">
    <xsd:length value="z"/>
  </xsd:restriction>
</xsd:simpleType>
where type is one of:
  • string
  • normalizedString
  • token
  • Name
  • NMTOKEN
  • language
  • NCName
  • ID
  • IDREF
  • ENTITY

When CCSID=1200 at mapping level 4.0 and higher:



WIDECHAR(
z
)


<xsd:simpleType>
  <xsd:restriction base="xsd:type"></xsd:restriction>
</xsd:simpleType>
where type is one of:
  • duration
  • date
  • time
  • gDay
  • gMonth
  • gYear
  • gMonthDay
  • gYearMonth

All mapping levels:

CHAR(32)
<xsd:simpleType>
  <xsd:restriction base="xsd:dateTime"></xsd:restriction>
</xsd:simpleType>

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)
The format of the time stamp is CICS ABSTIME.

<xsd:simpleType>
  <xsd:restriction base="xsd:hexBinary">
    <xsd:length value="y"/>
  </xsd:restriction>
</xsd:simpleType>

Mapping level 1.1 and below:



BIT(
z
)

where z = 8 × y and z < 4095 bytes.


CHAR(
z
)

where z = 8 × y and z > 4095 bytes.

Mapping levels 1.2 and higher:



CHAR(
y
)

<xsd:simpleType>
  <xsd:restriction base="xsd:byte"></xsd:restriction>
</xsd:simpleType>
All mapping levels:
Enterprise PL/I
SIGNED FIXED BINARY (7)
Other PL/I
FIXED BINARY (7)
<xsd:simpleType>
  <xsd:restriction base="xsd:unsignedByte"></xsd:restriction>
</xsd:simpleType>
All mapping levels:
Enterprise PL/I
UNSIGNED FIXED BINARY (8)
Other PL/I
FIXED BINARY (8)
<xsd:simpleType>
  <xsd:restriction base="xsd:short"></xsd:restriction>
</xsd:simpleType>
All mapping levels:
Enterprise PL/I
SIGNED FIXED BINARY (15)
Other PL/I
FIXED BINARY (15)
<xsd:simpleType>
  <xsd:restriction base="xsd:unsignedShort"></xsd:restriction>
</xsd:simpleType>
All mapping levels:
Enterprise PL/I
UNSIGNED FIXED BINARY (16)
Other PL/I
FIXED BINARY (16)
<xsd:simpleType>
  <xsd:restriction base="xsd:integer">
  </xsd:restriction>
</xsd:simpleType>
All mapping levels:
Enterprise PL/I
FIXED DECIMAL(31,0)
Other PL/I
FIXED DECIMAL(15,0)
<xsd:simpleType>
  <xsd:restriction base="xsd:int">
  </xsd:restriction>
</xsd:simpleType>
All mapping levels:
Enterprise PL/I
SIGNED FIXED BINARY (31)
Other PL/I
FIXED BINARY (31)
<xsd:simpleType>
  <xsd:restriction base="xsd:unsignedInt">
  </xsd:restriction>
</xsd:simpleType>
All mapping levels:
Enterprise PL/I
UNSIGNED FIXED BINARY(32)
Other PL/I
BIT(64)
<xsd:simpleType>
  <xsd:restriction base="xsd:long">
  </xsd:restriction>
</xsd:simpleType>
Mapping level 1.1 and below:
Enterprise PL/I
SIGNED FIXED BINARY(63)
Note: The LIMITS compiler directive might affect how the PL/I compiler interprets this field. CICS expects the field to be of the declared size, but the compiler might optimize the field into a smaller space, which can result in a mismatch. To avoid such problems, use the LIMITS(FIXEDBIN(63)) compile-time option.
Mapping level 1.2 and higher:
Enterprise PL/I
CHAR( y )

where y is a fixed length that is less than 16 MB.

All mapping levels:
Other PL/I
BIT(64)
<xsd:simpleType>
  <xsd:restriction base="xsd:unsignedLong">
  </xsd:restriction>
</xsd:simpleType>
Mapping level 1.1 and below:
Enterprise PL/I
UNSIGNED FIXED BINARY(64)
Note: The LIMITS compiler directive might affect how the PL/I compiler interprets this field. CICS expects the field to be of the declared size, but the compiler might optimize the field into a smaller space, which can result in a mismatch. To avoid such problems, use the LIMITS(FIXEDBIN(63)) compile-time option.
Mapping level 1.2 and higher:
Enterprise PL/I
CHAR( y )

where y is a fixed length that is less than 16 MB.

All mapping levels:
Other PL/I
BIT(64)
<xsd:simpleType>
  <xsd:restriction base="xsd:boolean">
  </xsd:restriction>
</xsd:simpleType>
Mapping level 1.1 and below:
Enterprise PL/I
SIGNED FIXED BINARY (7)
Other PL/I
FIXED BINARY (7)
Mapping level 1.2 and higher:
Enterprise PL/I
BIT(7)
BIT(1)
Other PL/I
BIT(7)
BIT(1)
where BIT(7) is provided for alignment and BIT(1) contains the Boolean mapped value.

<xsd:simpleType>
  <xsd:restriction base="xsd:decimal">
    <xsd:totalDigits value="n"/>
    <xsd:fractionDigits value="m"/>
  </xsd:restriction>
</xsd:simpleType>

All mapping levels:

FIXED DECIMAL( n , m )
<xsd:simpleType>
  <xsd:list>
    <xsd:simpleType>
      <xsd:restriction base="xsd:int"/>
    </xsd:simpleType>
  </xsd:list>
</xsd:simpleType>

All mapping levels:

CHAR(255)
<xsd:simpleType>
  <xsd:union memberTypes="xsd:int xsd:string"/>
</xsd:simpleType>

All mapping levels:

CHAR(255)

<xsd:simpleType>
  <xsd:restriction base="xsd:base64Binary">
    <xsd:length value="y"/>
  </xsd:restriction>
</xsd:simpleType>

<xsd:simpleType>
  <xsd:restriction base="xsd:base64Binary">
  </xsd:restriction>
</xsd:simpleType>
where the length is not defined

Mapping level 1.0:

Not supported

Mapping level 1.1:



CHAR(
z
)

where z =4×(ceil( y /3)). ceil( x ) is the smallest integer greater than or equal to x.

Mapping level 1.2 and higher:



CHAR(
y
)

where the length is fixed.

CHAR(16)
where the length is not defined. The field holds the 16-byte name of the container that stores the binary data.

<xsd:simpleType>
  <xsd:restriction base="xsd:float">
  </xsd:restriction>
</xsd:simpletype>

Mapping levels 1.0 and 1.1:


CHAR(32)

Mapping level 1.2 and higher:
Enterprise PL/I
DECIMAL FLOAT(6) HEXADEC
Other PL/I
DECIMAL FLOAT(6)
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.
<xsd:simpleType>
  <xsd:restriction base="xsd:double">
  </xsd:restriction>
</xsd:simpletype>

Mapping levels 1.0 and 1.1:


CHAR(32)

Mapping level 1.2 and higher:
Enterprise PL/I
DECIMAL FLOAT(16) HEXADEC
Other PL/I
DECIMAL FLOAT(16)
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.