This section of the spec seems wrong: 14.1 Empty Sequences A sequence having no children is syntactically legal in DFDL. In the data stream, such a sequence can have non-zero length LeftFraming and RightFraming regions, but the SequenceContent region in between must be empty. It is a processing error if the SequenceContent region of an empty sequence has non-zero length when parsing. XML schema does not define an empty sequence that is the content model of a complex type definition as effective content so any DFDL annotations on such a construct would be ignored. It is a schema definition error if the empty sequence is the content model of a complex type, or if a complex type has nothing in its content model at all. This seems like it is both legal and useful: <complexType name="headerRowType"> <sequence dfdl:initiator="name%WSP+;address%WSP+;phone" dfdl:terminator="%NL"/> </complexType> So the statement, DFDL annotations on such a construct would be ignored, is not right. And also a complexType sequence might actually have content via dfdl:hiddenGroupRef. <complexType name="hiddenGroupType"> <sequence dfdl:hiddenGroupRef="myHiddenGroup"/> </complexType> So the statement that the region in-between left and right framing must be empty is also not right. Comments? -- Mike Beckerle | OGF DFDL Workgroup Co-Chair | Tresys Technology | www.tresys.com
See this errata:
2.48. Section 14.1. Spec states that an empty sequence that is the content
of a complex type is a schema definition error. Many schema processors are
not able to distinguish this condition from a complex type with no content
at all (it is not required to do so by the XML Schema specification). As a
complex type with no content is not useful in DFDL, change the spec to
state that both conditions are schema definition errors.
This was raised by Sandy Gao of the W3C XSD WG.
So your example...
<complexType name="headerRowType">
<sequence dfdl:initiator="name%WSP+;address%WSP+;phone"
dfdl:terminator="%NL"/>
</complexType>
...would be treated by some XSD processors as...
<complexType name="headerRowType">
</complexType>
...and the DFDL annotations lost.
You can always use a nested sequence.
Regards
Steve Hanson
Architect, IBM Data Format Description Language (DFDL)
Co-Chair, OGF DFDL Working Group
IBM SWG, Hursley, UK
smh@uk.ibm.com
tel:+44-1962-815848
From: Mike Beckerle
participants (2)
-
Mike Beckerle
-
Steve Hanson