>> Changes made after comments on the call today. Should now be ok to add to spec draft 0.35.

For approval on this week's call. This property permits instances of specific elements to 'float' in the representation, as is found in some real-world formats such as X12, with its NTE segment.
Property Description
floating Boolean

Whether the occurrences of an element in an ordered sequence can appear out-of-order in the representation. A value for dfdl:floating is only acted upon if the immediate parent is a sequence and dfdl:sequenceKind="ordered"; it is ignored otherwise.

When parsing, and dfdl:floating is true, instances of the element may be encountered in the representation in any position within its containing sequence, but, if present, are placed into the infoset in schema declaration order. If the element repeats, instances do not need to be contiguous in the representation.

When parsing, and dfdl:floating is false, instances of the element are expected in schema declaration order, and, if present, they are placed into the infoset in schema declaration order. It is a processing error if instances of the element are not encountered in schema declaration order.

When unparsing, instances of the element are expected in the infoset in schema declaration order, and are output in the representation in schema declaration order. It is a processing error if instances of the element are not encountered in schema declaration order,

It is a schema definition error if an unordered sequence or a choice contains any element with dfdl:floating="true".

It is a schema definition error if an ordered sequence contains any element with dfdl:floating="true" and non-element content.

Annotation: dfdl:element on a simple or complex local element or element reference



Notes:
a) It should be clarified in the spec that the instances of a repeating element in an unordered sequence do not need to be contiguous either. This is in keeping with the behaviour of xs:all groups in XML Schema 1.1.

b) The consequence of the above statements of behaviour is that an ordered sequence of n element children with either n or n-1 of those children with dfdl:floating="true" is equivalent to an unordered sequence with the same n element children with dfdl:floating="false".  (This is deliberate design decision to aid consumability and implementations.)

c) A complex element with dfdl:floating="true" can have as its content model a sequence with elements that also have dfdl:floating="true".

d) This makes every element in a sequence containing one or more floating elements a point of uncertainty, in the same way as every element in an unordered sequence is a point of uncertainty.

e) dfdl:floating is not allowed on a global element to be consistent with what we decided about occurs related properties, which only come into play when an element is used. This, plus the fact that "false" will typically be the scoped value of dfdl:floating, means that dfdl:floating="true" will invariably only appear explicitly on a local element or group reference. For this reason, its appearance in a choice or unordered sequence is deemed deliberate, and it is ok to treat this as a schema definition error.

Regards

Steve Hanson
Programming Model Architect
WebSphere Message Brokers
Hursley, UK
Internet: smh@uk.ibm.com
Phone (+44)/(0) 1962-815848





Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU