The DFDL specification only allows for a choice branch to specify a single key value. Daffodil has expanded this to allow for a space delimiated list of keys. However, this does not support the case where a large number of contiguous integers are the key. Are standard advice there is to use a more complicated dispatch expression, such as:
if( (10 le tag) and (tag le 512)) then 'a' else 'b') However, this approach breaks down where there area a large number of ranges (for exactly the same reason that this approach breaks down when there are a large number of single values), and is not particuarly declerative. We face a simmilar problem with the recent Enumeration support. There, we solved it by including a repValueRanges attribute to go along with the repValues attribute. I am proposing a simmiliar addition for choice branches. The daf:choiceBranchKeyRanges will be a whitelist delimiated list of integers, interperated as "min1 max1 min2 max2 ... minN maxN", which will be logically equivalent to including all of "min1 min1+1 ... max1 ... minN minN+1 ... maxN" in the dfdl:choiceBranchKey annotation; and can be used in conjucntion or instead of the choiceBranchKeyAnnotation. In addition to making the complex case of many ranges possible, this will also simplify (and make more efficient) the case of 1 or few ranges. Brandon T. Sloane Associate, Services [email protected] | tresys.com
