Mapping of XML Schema Types to COBOL
The Plug-in maps XML schema types to the COBOL clauses, as shown here.
In this table xs refers any of the three namespaces:
- http://www.w3.org/2001/XMLSchema
- http://www.w3.org/2000/10/XMLSchema
- http://www.w3.org/1999/XMLSchema
| Schema Simple Type | COBOL Clause |
|---|---|
| xs:anyType
xs:anySimpleType xs:anyURI |
PIC X(255) |
| xs:base64Binary
xs:ENTITIES xs:ENTITY xs:hexBinary xs:ID xs:IDREF xs:IDREFS xs:language xs:Name xs:NCName xs:NMTOKEN xs:NMTOKENS xs:normalizedString xs:NOTATION xs:QName xs:string xs:token |
PIC X(...) |
| xs:boolean | PIC X DISPLAY |
| xs:byte
xs:int xs:integer xs:long xs:negativeInteger xs:nonPositiveInteger xs:short |
PIC S9(x) COMP
where xs:totalDigits value="x" PIC S9(default-x) COMP-5 if xs:totalDigits does not exist See Schema Simple Types for the default values. |
| xs:date | PIC 9(8) BINARY DATE FORMAT x |
| xs:dateTime
xs:duration xs:time |
PIC X(32) |
| xs:decimal | PIC S9(x-y)V9(y) COMP-3 |
| xs:double | USAGE COMP-2 |
| xs:float | USAGE COMP-1 |
| xs:gDay | PIC 9(2) BINARY DATE FORMAT XX |
| xs:gMonth | PIC 9(2) BINARY DATE FORMAT XX |
| xs:gMonthDay | PIC 9(4) BINARY DATE FORMAT XXXX |
| xs:gYear | PIC 9(4) BINARY DATE FORMAT YYYY |
| xs:gYearMonth | PIC 9(6) BINARY DATE FORMAT YYYYXX |
| xs:nonNegativeInteger
xs:positiveInteger xs:unsignedByte xs:unsignedInt xs:unsignedLong xs:unsignedShort |
PIC 9(x) COMP-5
See Schema Simple Types for the default length values. |
