[DFDL-WG] Action 271: semantic of maxoccurs '0'

Steve Hanson smh at uk.ibm.com
Tue Nov 18 06:39:32 EST 2014


We still need words to capture what is in the two tables though.  The spec 
today does not say what the parser or unparser does when asked to process 
zero occurrences of an element (whether stipulated by maxOccurs or 
dfdl:occursCount), and that's the behaviour given in the tables and 
accompanying notes.

Regards
 
Steve Hanson
Architect, IBM 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:     Steve Hanson/UK/IBM at IBMGB
Cc:     DFDL-WG <dfdl-wg at ogf.org>
Date:   17/11/2014 20:02
Subject:        Re: [DFDL-WG] Action 271: semantic of maxoccurs '0'



I looked through the Spec at each use of the word maxOccurs.

I saw nowhere that had to be modified if we stipulate that maxOccurs can 
be zero. 

Hence, I think the only thing we need to do is (1) explicitly state 
maxOccurs can be zero, and I suggest we also provide a suggested use case. 
I think the use case would be to accept a prior version of a 
DFDL-described data format, but have validation fail for elements that are 
not supposed to be present anymore in a revised version of that schema.

I believe section 5.2.1 is the right place for this stipulation. The use 
case can go in a footnote perhaps.


Mike Beckerle | OGF DFDL Workgroup Co-Chair | Tresys Technology | 
www.tresys.com
Please note: Contributions to the DFDL Workgroup's email discussions are 
subject to the OGF Intellectual Property Policy


On Mon, Oct 13, 2014 at 10:39 AM, Steve Hanson <smh at uk.ibm.com> wrote:
271
Use of maxOccurs '0' (All) 
2/9: Legal in XSDL and DFDL. One use case in XSDL is when deriving a 
complex type by restriction, where it is used to indicate that an element 
in the base type must not appear. Another use case could be if a schema 
undergoes a version revision that removes elements; perhaps clearer if the 
removed element gets maxOccurs '0' rather than omitting it. Steve has seen 
an instance of its use in a DFDL schema. 
So if DFDL continues to support it, need to document the behaviour for the 
various occursCountKinds and what happens to separator. Also behaviour of 
occursCount expression that returns 0. Proposal needed. 
... 
23/9: No progress
IBM has discussed this internally and has the following proposal. Infoset 
refers to the augmented infoset. 

OCK 
maxOccurs '0'
Parsing 
Unparsing 
fixed 
No occurrences looked for in the data (1) 
No occurrences looked for in the infoset or written (2) 
implicit 
No occurrences looked for in the data (1) 
No occurrences looked for in the infoset or written (2) 
expression 
occursCount occurrences expected. If any are found it is a validation 
error. 
Any number of occurrences expected in the infoset and written. If any are 
found it is a validation error. 
parsed 
Any number of occurrences expected in the data. If any are found it is a 
validation error. 
Any number of occurrences expected in the infoset and written. If any are 
found it is a validation error. 
stopValue 
Any number of occurrences expected in the data. If any are found it is a 
validation error. 
Any number of occurrences expected in the infoset and written. If any are 
found it is a validation error.

OCK 
Parsing and occursCount '0' 
Unparsing and no occurrences in infoset 
expression 
No occurrences looked for in the data. (1) 
No occurrences written. (2)

Notes 
(1) If sequence has a separator, no separator is looked for in the data 
when parsing. 
(2) If sequence has a separator, no separator is output when unparsing. 

Regards
 
Steve Hanson
Architect, IBM DFDL
Co-Chair, OGF DFDL Working Group
IBM SWG, Hursley, UK
smh at uk.ibm.com
tel:+44-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

--
  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/20141118/b1375364/attachment.html>


More information about the dfdl-wg mailing list