Data Format Description Language (DFDL) v1.0 Specification
OGF Proposed Recommendation GFD-P-R.174, January 31, 2011


14.2 Sequence Groups with Delimiters

The following additional properties apply to sequence groups that use text delimiters to separate child content.
Property Name Description
separator

List of DFDL String Literals or DFDL Expression

Specifies a whitespace separated list of alternative literal strings that are the possible separators between a sequence of elements or multiple occurrences of an element.

The Separator, PrefixSeparator and PostfixSeparator regions contain one of the strings specified by the dfdl:separator property. When this property has "'"' (empty string) as its value then the separator region is of length zero.

On unparsing the first separator in the list is used as the separator.

This property can be computed by way of an expression which returns a string of whitespace separated values. The expression must not contain forward references to elements which have not yet been processed.

If a child element uses an escape scheme, then the escape scheme also applies to any separator.

If dfdl:ignoreCase is 'yes' then the case of the string is ignored by the parser.

Annotation: dfdl:sequence, dfdl:group (sequence)

separatorPosition

Enum

Valid values ‘infix’, ‘prefix’, ‘postfix’

‘infix’ means the separator occurs between the elements in the Separator grammar region.

‘prefix’ means the separator occurs before each element n both the Separator grammar region and the PrefixSeparator grammar region.

‘postfix’ means the separator occurs after each element in the Separator grammar region and the PostfixSeparator grammar region.

Annotation: dfdl:sequence, dfdl:group (sequence).

separatorPolicy

Enum

Valid values ‘required', ‘suppressed', ‘suppressedAtEndStrict’, ‘suppressedAtEndLax’

Specifies whether to expect a separator when an element is missing. Ignored unless dfdl:separator is specified and is not "" (empty string).

This property applies when dfdl:sequenceKind is 'ordered'

See section ‎14.2‎1 Sequence Groups and Separators.

'suppressed' implies it must be possible for speculative parsing to identify which elements are present.

'suppressedAtEndStrict' and 'suppressedAtEndLax' can only be used when there is no clash with delimiters from the containing structure.

Annotation: dfdl:sequence, dfdl:group (sequence)

documentFinalSeparatorCanBeMissing

Enum

Valid values are 'yes', 'no'

When the documentFinalSeparatorCanBeMissing property is true, then when an element is the last element in a sequence or array is also the last element in the data stream, then on parsing, it is not an error if the postfix separator is not found.

For example, if the data are in a file, and the format specifies lines terminated by the newline character (typically LF or CRLF), then if the last line is missing its newline, then this would normally be an error, but if documentFinalSeparatorCanBeMissing is true, then this is not a processing error.

On unparsing the separator is always written out regardless of the state of this property.

Annotation: dfdl:format (on xs:schema only)

14.2.1 Sequence Groups and Separators

A number of issues arise in explaining sequence groups having separators.

There are 5 distinct kinds of sequence groups.

sequenceKind

separatorPolicy

Implications

ordered

required

All separators MUST be found in the data. When the last element in the sequence is an array then separators will be output, after the last occurrence, up to xs:maxOccurs if there aren't sufficient occurrences. It is a schema definition error if xs:maxOccurs is 'unbounded'

ordered

suppressedAtEndStrict

Separators MUST be omitted for any 'missing elements' at the end of the sequence. When the last element in the sequence is an array then separators will be output up to the last occurrence.

ordered

suppressedAtEndLax

Separators MAY be omitted for any 'missing elements' at the end of the sequence. When the last element in the sequence is an array then separators will be output up to the last occurrence.

ordered

suppressed

Separators MAY be omitted for 'missing elements'. It must be possible for speculative parsing to identify which elements are present.

unordered

ignored (suppressed behavior implied)

Table 21 Sequence groups and separators

 


Copyright (C) Open Grid Forum (2005-2010). All Rights Reserved.

This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the OGF or other organizations, except as needed for the purpose of developing Grid Recommendations in which case the procedures for copyrights defined in the OGF Document process must be followed, or as required to translate it into languages other than English.