
Definitions of Potentially Trailing things mention "enclosing group", but choices don't qualify. A group in XSD is a sequence or a choice, so if we mean enclosing sequence, we can't slide by with enclosing group. We need to to a complete pass through the spec, searching for uses of the word group. All such should mean "sequence or choice", or should be changed to one of those otherwise. My edits for section 14.2.1 are here in colored background: Potentially trailing element – An array or optional element describes an occurrence that is said to be potentially trailing if the element is capable of having a zero length representation and is followed in its enclosing sequence definition by only additional potentially trailing elements or potentially trailing groups. Intuitively, the array or optional element occurrence could be last. Potentially trailing group – A group is said to be potentially trailing if the group has no framing and contains only potentially trailing element declarations/references, or recursively similar sequence or choice groups, and is followed in its enclosing sequencedefinition by only additional potentially trailing elements or potentially trailing groups. Trailing or Actually Trailing – An element occurrence or group occurrence in the data is said to be actually trailing if it is potentially trailing and has zero-length representation and is not followed in the data by any other non-zero length element occurrence or group occurrence limited by the end of the enclosing sequence group. The phrase "followed in its enclosing group definition..." is meaningless if the enclosing group is a choice, as choice alternatives don't have an ordering relationship that corresponds to physical position in the data. All of these definitions are flawed in the following sense. When we say last, we mean "last represented" in almost all cases, because another element following, which has an inputValueCalc doesn't count, nor a sequence group with no framing, containing only elements with inputValueCalc or similar sequences, nor an element with complex type having only that stuff, etc. So it seems we need the more general concept of "is represented" in the spec, so that when we say "last" we can be clear. Trailing or Actually Trailing says "... is not followed in the data by any other ...". This is unclear because "is not followed in the data" doesn't express any limit at all. What we mean here is limited by only up to the end of the sequence group whose children/separators are under discussion. -- Mike Beckerle | OGF DFDL Workgroup Co-Chair | Tresys Technology | www.tresys.com