Rational Developer for System z

Mapping XML Schema data types to Enterprise PL/I data declarations

This section describes how XSD built-in primitive and derived datatypes are mapped to PL/I data declarations in the WSDL2PLI scenario.

XML schema datatypes fall into one of two categories: primitive or derived. A derived data type is created by extending an existing primitive or extended data type. For example, xsd:integer is a built-in derived type that is derived from the built-in primitive data type xsd:decimal (xsd:integer is an xsd:decimal with the fractionDigits facet set to 0).

A derived data type can be created by setting restrictions in the facets of the source data type. Both primitive and derived built-in datatypes can be extended by this type of restriction to create custom reusable simple type definitions.
Note: A full description of how XML Schema can be used to define the structure and layout of an XML document is in the W3C standard specification XML Schema Part 1: Structures Second Edition. Information on how to specify and constrain the data present in an XML document can be found in the W3C standard specification XML Schema Part 2: Datatypes Second Edition.
The following tables describe the Enterprise PL/I data declarations that the WSDL2PLI component generates for each XSD built-in primitive and derived data type.
Note: The information in this section also applies to user-defined xsd:simpleTypes.

Table 1. XSD to PL/I: Boolean, string and related data types, date and time data types
XSD built-in data type: Enterprise PL/I data declaration:

base64Binary

  (n) BIT(8) ALIGNED

  if the length or maxLength facet is specified:
      n = value of length or maxLength facet

  else if minLength alone is specified
      n = max(default_base64binary_length, minLength)

  else
      n = default_base64binary_length

  boolean

  BIT(1) ALIGNED

  Comments:
     • The following facets are not used: whiteSpace and pattern.

  string
  normalizedString
  token
  name
  NMTOKEN
  language
  NCName
  ID
  IDREF
  anyURL
  QName
  NOTATION

  If the length facet is specified:
      CHAR (n) or WCHAR (m),
      where n =  min(length, 32767) and m = min(length, 16383);  

  else if the minLength and maxLength facets are specified:
      CHAR (n) VARYING or WCHAR (m) VARYING,
      where n =  min(max(minLength, maxLength), 32767),
      and m = min(max(minLength, maxLength), 16383);

  else if the enumeration facet is specified:
      CHAR (n) VARYING or WCHAR (m) VARYING,
      where n = min(max(strlen(enumeration[*])), 32767),
      and m =  min(max(strlen(enumeration[*])), 16383);

  else:
      CHAR (n) VARYING or WCHAR (m) VARYING,
      where n = min(default_string_length, 32767),
      and m = min(default_string_length, 16383).

  Comments:
    • WCHAR is generated when host_ccsid_is_dbcs is set to true.
    • The whiteSpace facet is applied to XML generation only.
    • The pattern facet is not used.

  date
  dateTime
  duration
  gDay
  gMonth
  gMonthDay
  gYear
  gYearMonth
  time

  CHAR (n) VARYING or WCHAR (m) VARYING,
      where n = min(default_date_time_length, 32767),
      and m = min(default_date_time_length, 16383).

  Comments:
    • WCHAR is generated when host_ccsid_is_dbcs is set to true.
    • The whiteSpace facet is used by language structure to XML
conversion only.
    • The following facets are not used: pattern, enumeration, maxInclusive, maxExclusive, minInclusive, and minExclusive.

 

Table 2. XSD to PL/I: Unsigned integer data types
XSD built-in data type: Enterprise PL/I data declaration:

  unsignedByte

  UNSIGNED FIXED BIN (8)
  
  Comments:
    • The following facets are not used: totalDigits, fractionDigits, pattern, enumeration, whiteSpace, maxInclusive,  maxExclusive, minInclusive, and minExclusive.

  unsignedShort

  UNSIGNED FIXED BIN (16)
  
  Comments:
     • The following facets are not used: totalDigits, fractionDigits, pattern, enumeration, whiteSpace, maxInclusive,  maxExclusive, minInclusive, and minExclusive.

  unsignedInt

  UNSIGNED FIXED BIN (32)
  
  Comments:
      • The following facets are not used: totalDigits, fractionDigits, pattern, enumeration, whiteSpace, maxInclusive,  maxExclusive, minInclusive, and minExclusive.

  unsignedLong

  UNSIGNED FIXED BIN (64)
  
  Comments:
    • Requires compiler option LIMITS(FIXEDBIN(31,63)).
    • The following facets are not used: totalDigits, fractionDigits, pattern, enumeration, whiteSpace, maxInclusive,  maxExclusive, minInclusive, and minExclusive.

 

Table 3. XSD to PL/I: Signed integer data types
XSD built-in data type: Enterprise PL/I data declaration:

  Integer
  positiveInteger
  negativeInteger
  nonPositiveInteger
  nonNegativeInteger

  FIXED DECIMAL(n, 0)

      If the totalDigits facet is specified:
          n = min(totalDigits, 31);
      else:
          n = min(default_total_digits, 31);

  Comments:
    • The following facets are not used: fractionDigits, pattern, enumeration, whiteSpace, maxInclusive, maxExclusive, minInclusive, and minExclusive.

  byte

  SIGNED FIXED BIN (7)

  Comments:
    • The following facets are not used: totalDigits, fractionDigits, pattern, enumeration, whiteSpace, maxInclusive,  maxExclusive, minInclusive, and maxInclusive.

  short

  SIGNED FIXED BIN (15)

  Comments:
    • The following facets are not used: totalDigits, fractionDigits, pattern, enumeration, whiteSpace, maxInclusive, maxExclusive, minInclusive, and minExclusive.

  int

  SIGNED FIXED BIN (31)

  Comments:
    • The following facets are not used: totalDigits, fractionDigits, pattern, enumeration, whiteSpace, maxInclusive, maxExclusive, minInclusive, and minExclusive.

  long

  SIGNED FIXED BIN (63)

  Comments:
    • Requires compiler option LIMITS(FIXEDBIN(31,63)).
    • The following facets are not used: fractionDigits, pattern, enumeration, whiteSpace, maxInclusive,  maxExclusive, minInclusive, and minExclusive.

 

Table 4. XSD to PL/I: Decimal and floating point data types
XSD built-in data type: Enterprise PL/I data declaration:

  decimal

  FIXED DECIMAL (n, m)

  if the totalDigits and the fractionDigits facets are specified:
      n = min(totalDigits, 31),
      m = min(fractionDigits, 31);

  else if the totalDigits facet is specified:
      n = min(totalDigits, 31),
      m = min(default_fraction_digits, 31);

  else if the fractionDigits facet is specified:
       n = min(default_total_digits, 31),
       m = min(fractionDigits, 31);

  else:
      n = min(default_total_digits, 31),
      m = min(default_fraction_digits, 31).

  Comments:
    • The following facets are not used: pattern, enumeration, whiteSpace, maxInclusive, and maxExclusive.

  float

  FLOAT BIN(21) IEEE

  Comments:
    • Native support for IEEE single-precision binary floating point.
    • The following facets are not used: pattern, enumeration, whiteSpace, maxInclusive, maxExclusive, minInclusive, and minExclusive.

  double

  FLOAT BIN(53) IEEE

  Comments:
    • Native support for IEEE double-precision binary floating point.
    • Requires compiler option LIMITS(FIXEDBIN(31,63)).
    • The following facets are not used:  pattern, enumeration, whiteSpace, maxInclusive, maxExclusive, minInclusive, and minExclusive.

 

Table 5. XSD to PL/I: Data types not supported
XSD built-in data type: Enterprise PL/I data declaration:

  ENTITY

  Not supported.

  COMMENTS:
    • Unparsed entities require parsing or generation of an internal
or external DTD at execution time; this is not supported by
Compiled XML Conversion.

  ENTITIES
  IDREFS

  Not supported.

  COMMENTS:
    • Datatypes derived by list or union are not supported. Also see ENTITY.

  anySimpleType

  Not supported.

  COMMENTS:
    • xsd:anySimpleType is the base type of all built-in primitive and
derived datatypes. Therefore XML elements and attributes that
are of type xsd:anySimpleType can be of any built-in or user-defined
atomic, list, or union type at execution time.

  anyType

  Not supported.

  COMMENTS:
    • xsd:anyType is the base type from which all simple and
complex types are derived. An xsd:anyType type does not
constrain its content in any way. For example, the content of
an XML element that is of type xsd:anyType can be an
arbitrary XML document fragment in one occurrence and
base64Binary in another.


Feedback