Almost. The resulting infoset from a parse is reordered to match the
schema definition order. So in this case the infoset would look like this:

  <input>
    <A>12</A>
    <B>true</B>
  </input>

So even though the boolean appeared before the integer in the data, we
will reorder those elements in the infoset so that to integer is first.

Unparsing this infoset will give the same result you have of "12<CRLF>true"

Also, if you attempted to unparse your original infoset of:

  <input>
    <B>true</B>
    <A>12</a>
  </input>

you would get an error, since Daffodil expects the elements to be in
schema definition order.

And BTW, unordered sequence support is most likely going to be the next
release.


On 9/29/19 7:16 AM, Costello, Roger L. wrote:
> Hello DFDL community,
> 
> Unfortunately, Daffodil does not currently support 
> dfdl:sequenceKind="unordered".
> 
> Does the below graphic accurately show how unordered sequences would be 
> parsed 
> and unparsed?
> 
> *From:* Beckerle, Mike <mbecke...@tresys.com>
> *Sent:* Monday, September 23, 2019 1:55 PM
> *To:* users@daffodil.apache.org
> *Subject:* [EXT] Re: Is <xs:sequence dfdl:sequenceKind="unordered"> 
> equivalent 
> to <xs:all>?
> 
> An unordered sequence is not entirely equivalent to an xs:all group.
> 
> Specific differences are that while the representation is unordered in DFDL, 
> the 
> logical structure is ordered. On unparsing the order the data will come out 
> will 
> match schema order. The order that the data was in when parsed is lost, and 
> not 
> maintained anywhere.
> 
> If the order things appeared in matters and needs to be preserved, then you 
> need 
> to model the data as an array element containing a choice, with the members 
> of 
> the unordered sequence instead appearing as the members of this choice. The 
> array element preserves the order that the data arrived in.
> 
> --------------------------------------------------------------------------------
> 
> *From:*Costello, Roger L. <coste...@mitre.org <mailto:coste...@mitre.org>>
> *Sent:* Monday, September 23, 2019 1:48 PM
> *To:* users@daffodil.apache.org <mailto:users@daffodil.apache.org> 
> <users@daffodil.apache.org <mailto:users@daffodil.apache.org>>
> *Subject:* Is <xs:sequence dfdl:sequenceKind="unordered"> equivalent to 
> <xs:all>?
> 
> Hello DFDL community,
> 
> I realize that DFDL does not allow <xs:all>
> 
> But if it did, would the below be equivalent?
> 
> <xs:elementname="input">
> <xs:complexType>
> <xs:sequencedfdl:sequenceKind="unordered">
>              ...
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> 
> <xs:elementname="input">
> <xs:complexType>
> <xs:all>
>              ...
> </xs:all>
> </xs:complexType>
> </xs:element>
> 

Reply via email to