Yeah, this part  of the DFDL spec has some clarity issues.

The "data" never means the infoset (the XML output if you are using XML). It 
always refers to the data or data stream being parsed from, or unparsed to.  We 
try to use data stream to be clearer here.


That's what the intention is. There could be slips in the spec where data is 
used but "infoset" was intended. I don't know of those, but there's the 
possibility.


Trailing position means, in a sequence, that the item could be the last element 
or model-group in the sequence. That requires that everything after it is in 
some way optional, so that there might not be data representation for it, and 
hence, there may not be a need for a separator in the data stream for 
separating its representation.


So imagine a comma separated sequence of 5 elements, each an integer. They're 
all optional (minOccurs="0").


All these elements are potentially trailing, the question is just whether they 
are actually present and the last thing, or there's something after them.


Here's some example lines


1,2,3,4,5

1,,,,5

1,2                           // ok with trailingEmpty or trailingEmptyStrict

1,,,,                          // Illegal if trailingEmptyStrict, but allowed 
by trailingEmpty





________________________________
From: Costello, Roger L. <[email protected]>
Sent: Friday, December 21, 2018 2:51:16 PM
To: [email protected]
Subject: What is a trailing occurrence?


Hello DFDL community,



The DFDL specification has this:



separatorSuppressionPolicy       Implications

trailingEmptyStrict                           Positional sequence where 
trailing occurrences
                                                               that have zero 
length representation MUST be
                                                               omitted from the 
data, along with their
                                                               associated 
separator.



What is “trailing occurrence”? Does it imply the separator is in prefix 
position and hence the string (occurrence) is trailing (after the separator)?



Also, the above quoted text says: omitted from the data. What data? Does the 
word “data” refer to the XML output?



/Roger

Reply via email to