The current implementations of Data Format Description Language (DFDL) v 1.0 do not support unordered lists. Is there a workaround?
Asked
Active
Viewed 899 times
2 Answers
1
IBM's implementation now supports dfdl:sequenceKind="unordered" as per the DFDL 1.0 spec.

Steve Hanson
- 96
- 4
0
Yes, there is a workaround. As a simple example, suppose the input text is simply a set of characters (a, b, and c), which can appear in any order. To create an unordered list, create an element for each of the characters. Put them in a containing element, such that the container has an unbounded max number of occurrences and the child elements are all choices.
Conceptually, it looks like this:
Container Element
Choice
A Element
B Element
C Element
Use a discriminator to test for the existence of each character.
The DFDL schema looks like this (in part)
<xsd:element name="Container" dfdl:occursCountKind="implicit"
dfdl:terminator="" maxOccurs="unbounded" minOccurs="1" >
<xsd:complexType>
<xsd:choice>
<xsd:element name="a" dfdl:length="1" dfdl:lengthKind="explicit"
fixed="a" minOccurs="1" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://www.ogf.org/dfdl/">
<dfdl:discriminator>{. eq 'a'}</dfdl:discriminator>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="b" dfdl:length="1" dfdl:lengthKind="explicit"
fixed="b" minOccurs="1" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://www.ogf.org/dfdl/">
<dfdl:discriminator>{. eq 'b'}</dfdl:discriminator>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="c" dfdl:length="1" dfdl:lengthKind="explicit"
fixed="c" minOccurs="1" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://www.ogf.org/dfdl/">
<dfdl:discriminator>{. eq 'c'}</dfdl:discriminator>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
:

james.garriss
- 12,959
- 7
- 83
- 96