Skip to content

Parse error on date fields containing dashes #12

@lblatchford

Description

@lblatchford

Per MIL-STD-2500C CN2 section 5.1.7d (see https://gwg.nga.mil/ntb/baseline/docs/2500c/2500C.pdf) indicates that any portion of date and time fields that is not known may be populated with dashes. Currently such fields cause a parse error. Some examples:

Failed to convert: Parse Error: Failed to populate ImageSegment[1]. Cause: Parse Error: Unable to parse xs:dateTime from text: 201707--------
Schema context: ImageDateAndTime Location line 373 column 22 in file:/root/DFDL_schemas/nitf.dfdl.xsd
Data location was preceding byte 430 limit(bytes) 1009
Schema context: sequence[1] Location line 154 column 8 in file:/root/DFDL_schemas/nitf.dfdl.xsd
Data location was preceding byte 430Parse Error: Unable to parse xs:dateTime from text: 201707--------
Schema context: ImageDateAndTime Location line 373 column 22 in file:/root/DFDL_schemas/nitf.dfdl.xsd
Data location was preceding byte 430 limit(bytes) 1009

Failed to convert: Parse Error: Failed to populate ImageSegment[1]. Cause: Parse Error: Unable to parse xs:dateTime from text: --------------
Schema context: ImageDateAndTime Location line 373 column 22 in file:/root/DFDL_schemas/nitf.dfdl.xsd
Data location was preceding byte 430 limit(bytes) 1009
Schema context: sequence[1] Location line 154 column 8 in file:/root/DFDL_schemas/nitf.dfdl.xsd
Data location was preceding byte 430Parse Error: Unable to parse xs:dateTime from text: --------------
Schema context: ImageDateAndTime Location line 373 column 22 in file:/root/DFDL_schemas/nitf.dfdl.xsd
Data location was preceding byte 430 limit(bytes) 1009

Test files are attached
nitf_2_1_date_field_dashes.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions