[DFDL-WG] unordered sequence with constrained occurrences

Garriss Jr., James P. jgarriss at mitre.org
Tue Mar 5 13:10:35 EST 2013


Can this be done with one or more asserts?

From: Garriss Jr., James P.
Sent: Tuesday, March 05, 2013 8:43 AM
To: dfdl-wg at ogf.org
Subject: unordered sequence with constrained occurrences

Suppose text data has 3 constructs:  a, b, and c.


*       a must occur 1 time

*       b can occur 0 or 1 time

*       c can occur any number of times, 0 or more

These 3 constructs can appear in any order.

So these are valid inputs:

abc
a
bcccca

But these are not:

ccbcc
abbc
abcabc

Can data like this be modeled with DFDL?

The unordered sequence can be modeled with a data array, like this:

Array (0 to unbounded)
Sequence
  a (0 to 1)
  b (0 to 1)
  c (0 to 1)
/Sequence
/Array

But I don't know how to constrain the total number of occurrences.

Appreciate any ideas!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ogf.org/pipermail/dfdl-wg/attachments/20130305/489cff44/attachment.html>


More information about the dfdl-wg mailing list