[DFDL-WG] [wg-all] Repeating groups in DFDL

Steve Hanson smh at uk.ibm.com
Wed Jul 20 03:54:27 CDT 2011


A couple of clarifications if I may....

- In your example, you have someField as being of simple type, can it be 
complex type in your real format? 

- You said "If presentBit is zero, then A1 has zero occurences". But in 
your xsd you have A1 as (implied) minOccurs="1". I think you meant 
minOccurs="0"? 

Regards

Steve Hanson
Architect, 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:
Ryan Farrell <ryan.farrell.ctr at nrl.navy.mil>
To:
dfdl-wg at ogf.org
Date:
19/07/2011 19:12
Subject:
[DFDL-WG] [wg-all] Repeating groups in DFDL
Sent by:
dfdl-wg-bounces at ogf.org



For anyone that was at the 19/07  phone meeting, this is what Adam Fox 
and I were trying to find a solution to. If anyone knows of a solution, 
please contact me or adam.fox at nrl.navy.mil.

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

Please see the attached xml schema while reading this message.

The problem we want to solve is how to represent a structure that can 
have a variable amount of occurences (even zero), and the amount of 
repeats is controlled by a one bit field, which we will call"repeatBit". 
The repeating structure in this case is "A1". The element before it, 
"presentBit", determines if there is at least one occurence of A1. If 
presentBit is zero, then A1 has zero occurences. If presentBit is one, 
then A1 has AT LEAST one occurence.

The first element in A1 is "repeatBit". What repeatBit does is tells us 
if there will be another occurence of A1 after the current occurence. 
When repeatBit is zero, then that means we will read through the rest of 
A1, then that is the last occurence of A1. As long as repeatBit 
continues to be one however, we will read through the rest of A1, then 
start a new occurence.

I have included all the known required DFDL notation. Please let me know 
what is missing.

        EXAMPLE INPUT (results are in base 10):
        NOTE: Not all bits are used in these examples. Unused bits 
should be ignored for the purpose of the examples.

        1) 0111 0101
        presentBit = 0
        aFieldAfterA1 = 3

        2) 1011 1010
        presentBit = 1
        A1
        -repeatBit = 0
        -someField = 3
        aFieldAfterA1 = 2

        3) 1101 0110 0000 0000
        presentBit = 1
        A1
        -repeatBit = 1
        -someField = 1
        A1
        -repeatBit = 0
        -someField = 3
        aFieldAfterA1 = 0
[attachment "repeat_example.xsd" deleted by Steve Hanson/UK/IBM] --
  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/20110720/d4660c25/attachment.html 


More information about the dfdl-wg mailing list