[DFDL-WG] empty sequences
Steve Hanson
smh at uk.ibm.com
Wed Apr 24 12:47:30 EDT 2013
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 at uk.ibm.com
tel:+44-1962-815848
From: Mike Beckerle <mbeckerle.dfdl at gmail.com>
To: dfdl-wg at ogf.org,
Cc: Jessie Chab <jchab at tresys.com>
Date: 24/04/2013 17:21
Subject: [DFDL-WG] empty sequences
Sent by: dfdl-wg-bounces at ogf.org
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
--
dfdl-wg mailing list
dfdl-wg at ogf.org
https://www.ogf.org/mailman/listinfo/dfdl-wg
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ogf.org/pipermail/dfdl-wg/attachments/20130424/1ca4c1bf/attachment.html>
More information about the dfdl-wg
mailing list