Hello DFDL community, My (binary) input is this:
[cid:[email protected]] Parsing the input with this DFDL schema: <xs:element name="input"> <xs:complexType> <xs:sequence> <xs:element name="Section_1" type="Section_1_type" minOccurs="0" maxOccurs="unbounded" dfdl:occursCountKind="implicit"/> <xs:element name="Section_2" type="Section_2_type" minOccurs="0" maxOccurs="unbounded" dfdl:occursCountKind="implicit"/> <xs:element name="Section_3" type="Section_3_type" minOccurs="0" maxOccurs="unbounded" dfdl:occursCountKind="implicit"/> <xs:sequence dfdl:hiddenGroupRef="padToByteBoundary" /> </xs:sequence> </xs:complexType> </xs:element> produces this XML: <input> <Section_1> <code>1</code> <three-bits>3</three-bits> <one-bit>1</one-bit> </Section_1> <Section_1> <code>1</code> <three-bits>3</three-bits> <one-bit>1</one-bit> </Section_1> </input> If I remove maxOccurs="unbounded" on Section_3, then I get this warning message: [warning] Schema Definition Warning: Section_3 is an optional element or a variable-occurrence array and its alignment (1) is not the same as group[4]'s alignment (8). There is only one xs:group in my DFDL schema, so the warning message is clearly wrong. Despite the warning message, I get the same XML output. This seems like a bug in Daffodil. Yes? Below is my complete DFDL schema. /Roger <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/"> <xs:include schemaLocation="default-dfdl-properties/defaults.dfdl.xsd" /> <xs:include schemaLocation="unsignedint-types.dfdl.xsd" /> <xs:annotation> <xs:appinfo source="http://www.ogf.org/dfdl/"> <dfdl:format ref="default-dfdl-properties" /> </xs:appinfo> </xs:annotation> <xs:element name="input"> <xs:complexType> <xs:sequence> <xs:element name="Section_1" type="Section_1_type" minOccurs="0" maxOccurs="unbounded" dfdl:occursCountKind="implicit"/> <xs:element name="Section_2" type="Section_2_type" minOccurs="0" maxOccurs="unbounded" dfdl:occursCountKind="implicit"/> <xs:element name="Section_3" type="Section_3_type" minOccurs="0" maxOccurs="unbounded" dfdl:occursCountKind="implicit"/> <xs:sequence dfdl:hiddenGroupRef="padToByteBoundary" /> </xs:sequence> </xs:complexType> </xs:element> <xs:complexType name="Section_1_type"> <xs:sequence> <xs:element name="code" type="unsignedint2"> <xs:annotation> <xs:appinfo source="http://www.ogf.org/dfdl/"> <dfdl:assert test="{. eq 1}" /> </xs:appinfo> </xs:annotation> </xs:element> <xs:element name="three-bits" type="unsignedint3" /> <xs:element name="one-bit" type="unsignedint1" /> </xs:sequence> </xs:complexType> <xs:complexType name="Section_2_type"> <xs:sequence> <xs:element name="code" type="unsignedint2"> <xs:annotation> <xs:appinfo source="http://www.ogf.org/dfdl/"> <dfdl:assert test="{. eq 2}" /> </xs:appinfo> </xs:annotation> </xs:element> <xs:element name="four-bits" type="unsignedint4" /> <xs:element name="two-bits" type="unsignedint2" /> </xs:sequence> </xs:complexType> <xs:complexType name="Section_3_type"> <xs:sequence> <xs:element name="code" type="unsignedint2"> <xs:annotation> <xs:appinfo source="http://www.ogf.org/dfdl/"> <dfdl:assert test="{. eq 3}" /> </xs:appinfo> </xs:annotation> </xs:element> <xs:element name="four-bits" type="unsignedint4" /> <xs:element name="five-bits" type="unsignedint5" /> </xs:sequence> </xs:complexType> <xs:group name="padToByteBoundary"> <xs:sequence dfdl:alignment="8" dfdl:alignmentUnits="bits" dfdl:fillByte="%#r00;"/> </xs:group> </xs:schema>
