Additional thoughts on 5) occursCountKind="useAvailableSpace".


I had been thinking that occursCountKind="useAvailableSpace" was for all 'box' use cases but during discussions with Steve I realised that it does not cover the 2 use cases I had in mind.

1. COBOL occurs dependingOn with maximum occurrences allocated.

 Array complex element   dfdl:lengthKind='explicit' dfdl:length='{MaxOccur * Length(row)}'
   Sequence   dfdl:occursCountKind = 'expression' dfdl:occursCount = '{./NoOfOccurs}'
      Row dfdl:lengthKind='...........'


2. StopValue

 Array complex element   dfdl:lengthKind='explicit' dfdl:length='{MaxOccur * Length(Row)}'
   Sequence   dfdl:occursCountKind = 'StopValue'
      Row  dfdl:lengthKind='...........'


We need to articulate the use case for occursCountKind="useAvailableSpace".

Alan Powell

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



From: Steve Hanson/UK/IBM@IBMGB
To: dfdl-wg@ogf.org
Date: 30/11/2009 12:26
Subject: [DFDL-WG] Array clarifications (was Fw: Minutes for OGF DFDL Working Group Call, November-25-2009)






Discussed points 1-3 with Alan.


1) Alan thinks we didn't decide to limit discrimnators to choices - specifically that the optional scenario needs it. Steve thought this was just handled by speculative parsing, and that we limited discriminators to choices to simplify things for 1.0. More discussion needed in WG.


2) The minuted definition of dfdl:separatotPolicy="required" is in fact correct - it causes the parser to expect maxOccurs separators, and the unparser to output maxOccurs separators. Otherwise it is not possible for dfdl:occursCountKind="parsed" to handle extra separators that are included to make parsing unambiguous.  Combination "required" and maxOccurs="unbounded" is therefore an error.  


Keeps the rule simple, but you can end up with some slightly odd combinations (eg, "required" plus stop value is possible).


3) A
correction is needed to my revised dfdl:occursCountKind description, due to work item 061.
061
Change maxOccurs violations from processing error to validation error (if not 'fixed') 037



---------------------------------------------------------


Further discussion on array processing:


4) occursCountKind="expression". Is it a processing error if the number of occurrences in the data does not match the value of the expression?  

It was noted that the dfdl:outputValueCalc expression of a count field should use the dfdl:countWithDefault() function to ensure default values are taken into account.


5) occursCountKind="useAvailableSpace".  On unparsing, unused space should be padded with dfdl:fillByte (
added below).  But if the number in the infoset is a lot less than the box can hold, how do you know when re-parsing how many are in the box?  Also, if we are trying to fit things into a box, does it matter if items are left over? I suggested this was an error below.  Need Mike's input as he has seen the use cases for this.

6) Rename dfdl:separatorPolicy="required" to "always".


7) Noted that dfdl:separatorPolicy="suppress" and "suppressAtEnd" have the same behaviour for an array.

Regards

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

----- Forwarded by Steve Hanson/UK/IBM on 30/11/2009 10:02 -----
From: Steve Hanson/UK/IBM
To: dfdl-wg@ogf.org
Date: 27/11/2009 09:41
Subject: Re: [DFDL-WG] Minutes for OGF DFDL Working Group Call, November-25-2009





Three things:


1) I thought we had decided to limit dfdl:discriminator to choices?  Apologies if I didn't keep up with the discussion.


2) I don't think we got the rules right for dfdl:separatorPolicy="required" and arrays.  Yes, separators must be output for all items, but 'all' depends on dfdl:occursCountKind and not just maxOccurs.  In fact, the only time that maxOccurs has significance when parsing/unparsing is when dfdl:occursCountKind="fixed" - and in that case maxOccurs can not be unbounded. It should therefore not be a schema definition error when maxOccurs="unbounded" & dfdl:separatorPolicy="required".
occursCountKind Enum

Specifies how the actual number of occurrences is to be established.

Valid values 'fixed', ‘expression’, 'parsed’ ,‘stopValue’ or ‘useAvailableSpace’

 ‘fixed’ means use the value of the maxOccurs on the declaration. It is a schema definition error if the value for minOccurs is not equal to maxOccurs.

‘expression’ means use the value of the dfdl:occursCount property.

'parsed' means that the number of occurences is determined by normal speculative parsing such as discriminating by the initiator.

‘useAvailableSpace’ means the occurrences fill the available space which is limited by a containing construct.

‘stopValue’ means look for a logical stop value which signifies the end of the occurrences.

Annotation: dfdl:element



3) I think the dfdl:occursCountKind entry needs beefing up to address explicitly the parsing and unparsing behaviour for each enum. I know some of this stuff is elsewhere but I think it should also be here for clarity. Here's my first pass.  I have highlighted  where I'd like WG clarification.  

occursCountKind Enum

Specifies how the actual number of occurrences is to be established.

Valid values 'fixed', ‘expression’, 'parsed’ ,‘stopValue’ or ‘useAvailableSpace’

  •  ‘fixed’. Use the value of maxOccurs on the element declaration. It is a schema definition error if the value for minOccurs is not equal to maxOccurs. On parsing, maxOccurs are expected. On unparsing, maxOccurs are output.  
  • ‘expression’ means use the value of the dfdl:occursCount property. On parsing, dfdl:occursCount are expected. On unparsing, dfdl:occursCount are output.
  • 'parsed' means that the number of occurences is determined by the data itself. On parsing, this is established using normal speculative parsing such as discriminating by the initiator. On unparsing, all infoset items are output.
  • ‘useAvailableSpace’ means the occurrences fill the available space which is limited by a containing construct. On parsing, this is established using normal parsing rules. On unparsing, infoset items are output until the available space is exhausted or no items remain. Any unfilled space is filled with the dfdl:fillByte property value.
  • ‘stopValue’ means use the value(s) of the dfdl:occursStopValue property. On parsing, look for a logical stop value which signifies the end of the occurrences. On unparsing, all infoset items are output followed by a logical stop value. The stop value does not appear in the infoset, and does not contribute to the occurrences count.
On parsing and unparsing, after default rules are applied, it is a  processing error (if 'fixed') or a validation error (otherwise) if the number of occurrences does not lie between minOccurs and maxOccurs inclusive.

On unparsing, it is a processing error if items remain in the infoset after the designated occurrences have been output.

Annotation: dfdl:element




Regards

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


From: Alan Powell/UK/IBM@IBMGB
To: dfdl-wg@ogf.org
Date: 26/11/2009 16:59
Subject: [DFDL-WG] Minutes for OGF DFDL Working Group Call, November-25-2009
Sent by: dfdl-wg-bounces@ogf.org







Open Grid Forum: Data Format Description Language Working Group

OGF DFDL Working Group Call, November-25-2009

Attendees

Suman Kalia (IBM)

Steve Hanson (IBM)

Mike Beckerle (Oco)

Alan Powell (IBM)

Steve Marting (Progeny)

Peter Lambros (IBM)

Tim Kimber(IBM)


Apologies

Stephanie Fetzer (IBM)



1.        045 Resolving points of uncertainty - Disciminators
Continued discussion of semantics of discriminators and arrays.

Briefly reviewed Alan's update of the example to show discriminators only propagating to their parent. Flet that following WTX example was the best approach. IBM will more fully document WTX behaviour.


Discussed whether discriminators should only resolve choices but decided against as they are valuable to, for example, find an optional element that subsequently has a parsing error.

Also discussed that discriminators should only resolve the element they are defined on and whether that meant paths were not needed. Decided paths were needed for other purposes anyway.


Alan noted that the order of evaluation had not been defined for floating elements. Agreed this should be

- the element in that position

- followed by the floating elements in the order they are defined in the schema.



2.        045  -  parsing rules for determining length


Discussed Tim's suggestion that dfdl:lengthKind alone should indicate how an item is extracted from the data

explicit

The parser extracts a fixed number of characters/bytes from the input document as directed by dfdl:length ( which may be a DFDL expression, and may resolve to the value of the previous sibling )

prefixed

The parser extracts a fixed number of characters/bytes from the input document as directed by the prefix length. Note the similarity with the DFDL expression scenario above.

implicit

The parser extracts a fixed number of characters/bytes from the input document as directed by the implicit length of the element.

delimited

The parser extracts from the input document all characters between the current buffer position and the next unescaped item of in-scope terminating markup.

pattern

The parser extracts from the input document all characters which match the specified pattern

endOfParent
.

The parser extracts from the input document all remaining characters/bytes allowed by the representation properties of its parent groups/elements.


The terminating markup is only scanned for when lengtkind is 'delimited' and 'EndOfParent' when the end of the parent is delineated by markup.


This means that for formats such as the Swift 52A segment that distinguishes fields according to the length of data found, the lengthKind is delimited rather than explicit and a dfdl:assert is needed to test the length.


dfdl:length is only examined when dfdl:lengthKind is explicit.


It was agreed to change the function names of dfdl:length to dfdl:representationLength and dfdl:lengthWithoutPadding to RepresentationLengthWithoutParsing  to avoid confusion with the XPATH length. function.


Didn't discuss if this changes escaping rules.



3.        SeparatorPolicy=require and defaulting arrays and sequences
Discussed the semantics of dfdl:separatorPolicy with variable length arrays. Agreed that the behaviour should be the same for arrays as for sequences.


'supressAtEnd'  - separators must be output up to the last required item. That is up to the xs:minOccurs of a variable array. For simple items a default value will be output for missing required items.

'required'  - separators must be output for all items. That is up to xs:maxOccurs. It is a schema definition error if required and xs:maxOccurs= unbounded is specified.

'supress' -  separators are not output for missing items but for arrays there are no missing items so this is the same as dfdl:supressAtEnd.


Note: a group is always 'required' so at least one member must be present. However a group could be wrapped in an element which could be optional.



4.        Clarification of postfix separators, terminators,finalTerminatorCanBeMissing
Agreed to postpone to next call due to lack of time.


5.        Go through remaining actions

Updated below


6.        Test suite for DFDL

DFDL will be much more usable if it is accompanied by a set of tests that provide dfdl schema, sample data and expected results. IBM will investigate whether it will be possible to publish the format of the test cases that it is developing.

7.        OGF28 Call for papers

Steve H has sent a request for a slot in the agenda


8.        Plan to finish DFDL v1
MB agreed to investigate the tool available on gridforge for tracking problems with the spec. Agreed to start using this after version 37.



Meeting closed, 15:10


Next call 02 December 13:00 UK

Next action: 068

Actions raised at this meeting
No
Action
066
Investigate format for defining test cases
IBM to see if it is possible to publish its test case format.
067
Investigate problem tracking tools.

Current Actions:
No
Action
012
AP/SH: Update decimalCalendarScheme
10/9: Not allocated yet

17/9: No update

24/9: Add calendar binary formats to actions

22/10: No progress

16/1: proposal distributed and discussed. Will be redistributed

21/1: add locale,
04/02: changed from locale to specific properties

18/2: Need more investigation of ICU strict/lax behaviour.

08/04: Not discussed

22/04: AP to complete asap once the ICU strict/lax behaviour is understood.
29/04: No progress

06/05: No progress

13/05: Calendar has been added to latest spec version v034 but still a few details to clarify.

20/05: No Progress

...

09/06: No Progress (low priority)

17/06: SH to check ICU code for lax calendar behaviour

24/06: no progress

...

12/08: no progress

19/08: Inconsistencies are being found in ICU behaviour so Calendars need reviewing again.

26/08: Specific three character short time zones may not be  maintained during round tripping when there is more than one short form for a time zone offset. Because dates and datetimes in the infoset only maintain a time zone offset so on unparsing it isn't possible to say which short form will be selected for a particular offset when there is more than one possible. Need to document.

09/09: no progress

...

14/10: no progress

21/10: Will produce a list of known issues.

28/10: Discussed ICU farctional seconds behaviour. SF to send latest understanding.

04/11: no progress

11/11: no update

18/11: no update

25/11: no update
037
All: Approach for XML Schema 1.0 UPA checks.
22/04: Several non-XML models, when expressed in their most obvious DFDL Schema form, would fail XML Schema 1.0 Unique Particle Attribution checks that police model ambiguity.  And even re-jigging the model sometimes fails to fix this. Note this is equally applicable to XMl Schema 1.1 and 1.0. While the DFDL parser/unparser can happily resolve the ambiguities, the issue is one of definition. If an XSD editor that implements UPA checks is used to create DFDL Schema, then errors will be flagged. DFDL may have to adopt the position that:
a)DFDL parser/unparser will not implement some/all UPA checks (exact checks tbd)

b) XML Schema editors that implement UPA checks will not be suitable for all DFDL models

c) If DFDL annotations are removed, the resulting pure XSD will not always be valid (ie, the equivalent XML is ambiguous and can't be modelled by XML Schema 1.0)

Ongoing in case another solution can be found.

29/04: Will ask DG and S Gao for opinion before closing

06/05: Discussed S Gao email and suggestions. Decided need to review all XML UPA rules and decide which apply to dfdl.

20/05: SH or SKK to investigate

27/05: No Progress

03/06: The concern is that some dfdl schemas will fail UPA check when validation is turned on or when editted using tooling that enforces UPA checks. Renaming fields will resolve some/most issues. Need documentation  that  describes issue and best practice.

17/06: no change

24/06: no change

01/07: no progress

...

12/08: No Progress (lower priority)

19/08: Clarify that this action is to go through the XML UPA checks to assess impact on dfdl schemas and advice best practice. Name clashes is just one example. SH or SKK

26/08: No Progress (lower priority)

09/09: no progress

...

04/11: no progress

11/11: Steve has started to look at this. He has requested a 'consumable' definition of the UPA rules from the XSD WG members. Even non-normative Appendix H in the XSD 1.0 spec is hard to consume.

18/11: no update

25/11: Steve H has not found simpler definition so may just go through them.
045
20/05 AP: Speculative Parsing
27/05: Psuedo code has been circulated. Review for next call

03/06: Comments received and will be incorporated

09/06: Progress but not discussed

17/06: Discussed briefly

24/06: No Progress

01/07: No Progress

15/07: No progress. MB not happy with the way the algorithm is documented, need to find a better way.

29/07: No Progress
05/08: No Progress. Will document behaviour as a set of rules.

12/08: No Progress
...

16/09: no progress

30/09: AP distributed proposal and others commented. Brief discussion AP to incorporate update and reissue

07/10: Updated proposal was discussed.Comments will be incorporated into the next version.

14/10: Alan to update proposal to include array scenario where minOccurs > 0

21/10: Updated proposal reviewed

28/10: Updated proposal reviewed see minutes

04/11: Discussed semantics of disciminators on arrays. MB to produce examples

11/11: Absorbing action 033 into 045.  Maybe decorated discrminator kinds are needed after all. MB and SF to continue with examples.  

18/11: Went through WTX implementation of example. SF to gather more documentation about WTX discriminator rules.

25/11: Further discussion. Will get more WTX documentation. Need to confirm that no changes need to Resolving Uncertainty doc.
049
20/05 AP Built-in specification description and schemas
03/06: not discussed

24/06: No Progress

24/06: No Progress (hope to get these from test cases)

15/07: No progress. Once available, the examples in the spec should use the dfdl:defineFormat annotations they provide.

...

14/10: no progress

21/10: Discussed the real need for this being in the specification. It seemed that the main value is it define a schema location for downloading 'known' defaults from the web.
28/10: no progress

04/11: no progress

11/11: no update

18/11: no update

25/11: Agreed to try to produce for CSV and fixed formats
056
MB Resolve lengthUnits=bits including fillbytes
12/08: No Progress

...

28/10: no progress

04/11: MB to look at lengthUnits = bits

11/11: no update

18/11: no update

25/11: no update
063
Write DFDL primer and test cases.
11/11: no update

25/11: no update
064
MB/SH Request WG presentation at OGF 28
25/11: Session requested
065
Resolve parsing rules for various lengthKinds
25/11: Agreed dfdl:lengthKind define how to extract the data. Didn'r

t discuss if this changes escaping.
066
Investigate format for defining test cases
25/11:IBM to see if it is possible to publish its test case format.
067
25/11:Investigate problem tracking tools.

Closed actions
No
Action

Work items:
No
Item target version status
005
Improvements on property descriptions not started
011
How speculative parsing works (combining choice and variable-occurence - currently these are separate) (from action 045) awaiting completion of actions 045  
012
Reordering the properties discussion: move representation earlier, improve flow of topics not started
033
Numeric data - what physical reps are allowed for what logical types (from action 020) 037 ensure all behaviour documented
036
Update dfdl schema with change properties ongoing
038
Improve length section including bit handling some improvement in 036
042
Mapping of the DFDL infoset to XDM none not required for V1 specification
051
Revised scoping rules (from action 051) 037
058
textPadCharacter %#rxx limitation and split to textxxxxPadCharacter 037
059
limit terminatorCanBeMissing to last element in schema. Ignore elsewhere. 037
060
New empty string semantic for dfdl:binaryBooleanTrueRep 037
061
Change maxOccurs violations from processing error to validation error (if not 'fixed') 037
062
Drop calendarUseZForUTC. describe zU, IU and TU symbols 037
063
DefineFormat can contain only one active format. Drop baseFormat 037
064
Define how encoding,  byteorder and floating point format externally 037
065
Refactor dfdl:textNumberFormat to remove dfdl:numberBase. 037
066
document scope of selectors 037
067
document floating evaluation order 037
068
change  dfdl:length to dfdl:representationLength and dfdl:lengthWithoutPadding to RepresentationLengthWithoutParsing




Alan Powell

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





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@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












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@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