XMLNSC: XML Schema date formatting

The XMLNSC parser can parse and write all of the XML Schema simple types.

The rarely used types gYear, gYearMonth, gMonth, gMonthDay, and gDay do not map directly to an integration node data type. For these simple types, the XMLNSC parser adds one of the following constant values to the field type. This behavior allows the parser to produce the data for output in the same format as it was received.

Field types for controlling date format

The following field types are provided for XML Schema date format support. Do not use these field type constants in path expressions. Use them in conjunction with constants XMLNSC.Attribute and XMLNSC.Field to indicate the required output format for DATE values.

XMLNSC Field Type constant Purpose Value
XMLNSC.gYear Value must be a DATE. If the field type includes this value, the DATE value is written by using the XML Schema gYear format. 0x00000010
XMLNSC.gYearMonth Value must be a DATE. If the field type includes this value, the DATE value is written by using the XML Schema gYearMonth format. 0x00000040
XMLNSC.gMonth Value must be a DATE. If the field type includes this value, the DATE value is written by using the XML Schema gMonth format. 0x00000020
XMLNSC.gMonthDay Value must be a DATE. If the field type includes this value, the DATE value is written by using the XML Schema gMonthDay format. 0x00000050
XMLNSC.gDay Value must be a DATE. If the field type includes this value, the DATE value is written by using the XML Schema gDay format. 0x00000030

ESQL code example

DECLARE gYear DATE ‘2007-01-01';
-- Add in the gYear field type
DECLARE gYearFieldType INTEGER XMLNSC.Field + XMLNSC.gYear;
CREATE LASTCHILD OF OutputRoot DOMAIN ‘XMLNSC' NAME ‘XMLNSC';
CREATE LASTCHILD OF OutputRoot.XMLNSC TYPE gYearFieldType NAME ‘gYear' VALUE gYear;
Result : <gYear>2007</gYear>