Compatibility and interoperability between two different implementations is required for success of the DFDL standard.
The IBM DFDL implementation in their AppConnect product has a behavior for empty elements that is not in compliance with the DFDL v1.0 draft standard as of the Sept 2014 draft. This may be corrected/amended as the final draft is prepared. To provide interoperability in the mean time, a compatibility switch has been created.
This feature is implemented in the Daffodil 2.4.0 development branch / release. However, the property name, and the name of the property values are subject to change.
Property | Description |
---|---|
dfdlx:emptyElementParsePolicy | Enum Valid values are "treatAsMissing" or "treatAsEmpty" This property describes the behavior of the DFDL processor for empty elements of type xs:string or xs:hexBinary. When 'treatAsEmpty' an empty string/hexBinary that conforms to the dfdl:emptyValueDelimiterPolicy and which is required, the representation is understood to be empty, and it will be substituted with a default value (if defined). If no default value is defined the representation is understood to be normal, and the value will be an empty string, or zero-length xs:hexBinary. If the element occurrence is optional, nothing is added to the infoset. If the empty string/hexBinary does not conform to the emptyValueDelimiterPolicy, then if the element occurrence is required, no defaulting is performed, the representation is understood to be normal, and an empty string or zero-length hexBinary is added to the infoset. If the element occurrence is optional, then if the representation is zero-length the representation is understood to be absent, and, nothing is added to the infoset. However, if the representation is non-zero-length, the representation is understood to be normal, and an empty string or zero-length hexBinary is added to the infoset. When 'treatAsMissing' empty string/hexBinary values are never added to the infoset. When an empty string/hexBinary that conforms to the dfdl:emptyValueDelimiterPolicy and which is required is encountered, then if there is a default value to substitute, it is substituted. Otherwise a parse error is raised. If the element occurrence is optional nothing is added to the infoset. If the empty string/hexBinary does not conform to dfdl:emptyValueDelimiterPolicy, then no default value will be considered for a required occurrence, but otherwise the behavior is the same. An empty required occurrence causes a parse error, and an empty optional occurrence adds nothing to the infoset. |