[DFDL-WG] Validation of min/mxOccurs

Alan Powell alan_powell at uk.ibm.com
Thu Oct 8 09:31:10 CDT 2009


Tim 

As we discussed section 5.2.1 has not been updated to reflect the recent 
discussions on dfdl:occursCountKind.

>From the WG minutes of 23 September
The semantics of dfdl:occursCountKind='parsed' are 'parse as many as 
possible then validate against min/maxOccurs if validation is on. 

However section 15.13   Properties for Default Value Control states 
'An element of a variable-occurrence array is required if its index is 
less than or equal to the value of minOccurs.'
'If an element is required, but parsing does not find it, then if the 
element has a default value specified it is used as the logical value. If 
there is no default value then it is a processing error.'
'On unparsing, if an element is required, and is not part of the infoset 
and the element has a default value specified then it is used, otherwise 
it is a processing error.'

The last sentence should include arrays with not enough occurrences.

So if an array has too few occurrences (and no default) it is a processing 
error, if it has too many it is a validation error

Your questions

- When unparsing, the infoset might omit an element which has minOccurs > 
0. Should that be reported as a validation error, or a processing error? 
 >> if no default a processing error

- When unparsing, the infoset might omit an entire group. If all of the 
elements in the omitted group were optional, should this be considered an 
error ( because groups are implicitly required ) or not? 
>> The infoset doesn't really have groups only elements. So if you had an 
anonymous sequence in which all the elements were optional and they were 
missing it would not be an error. However if you have a complex element 
that contained an anonymous sequence in which all the elements were 
optional and they were missing would it be valid for the element to be 
missing? Don't know, discuss.

- When parsing an unordered group, if the input document contains more 
than  maxOccurs occurrences of one of the members, is that a processing 
error or a validation error? The specification seems to imply that it is a 
validation error, but that seems inconsistent with section 5.2.1
>> Validation  error  (5.2.1 needs updating)

Alan Powell

 MP 211, IBM UK Labs, Hursley,  Winchester, SO21 2JN, England
 Notes Id: Alan Powell/UK/IBM     email: alan_powell at uk.ibm.com 
 Tel: +44 (0)1962 815073                  Fax: +44 (0)1962 816898




From:
Tim Kimber/UK/IBM at IBMGB
To:
dfdl-wg at ogf.org
Date:
08/10/2009 10:20
Subject:
[DFDL-WG] Validation of min/mxOccurs




The specification is not entirely clear on a the following points 
a) If the input document contains too many occurrences of an element, 
should that be treated as a validation error, or a processing error? 
Section 5.2.1 says "It is a parse error when an array is found to have a 
number of occurrences not conforming to the minOccurs and maxOccurs 
constraints in the absence of a default value specification. 
Note that specifically, this is not a validation error, it is a processing 
error" 
Points to note: 
- When unparsing, the infoset might omit an element which has minOccurs > 
0. Should that be reported as a validation error, or a processing error? 
- When unparsing, the infoset might omit an entire group. If all of the 
elements in the omitted group were optional, should this be considered an 
error ( because groups are implicitly required ) or not? 
- When parsing an unordered group, if the input document contains more 
than  maxOccurs occurrences of one of the members, is that a processing 
error or a validation error? The specification seems to imply that it is a 
validation error, but that seems inconsistent with section 5.2.1 

It may be necessary to include a section which specifies how the DFDL 
processor should perform schema validation. 

regards,

Tim Kimber, Common Transformation Team,
Hursley, UK
Internet:  kimbert at uk.ibm.com
Tel. 01962-816742 
Internal tel. 246742





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
  http://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/20091008/5751bde4/attachment.html 


More information about the dfdl-wg mailing list