Hello DFDL community,
I swore that I would not use hidden groups, but I just can't bear to display
padding bits in the XML output.
My input file is binary. At the end of a section, there may be 0-7 padding
bits. The following doesn't work because outputValueCalc is not allowed on an
array:
<xs:group name="padding7Bits">
<xs:sequence>
<xs:element name="padding" minOccurs="0" maxOccurs="7"
dfdl:occursCountKind="implicit" type="unsignedint1"
dfdl:outputValueCalc="{0}" />
</xs:sequence>
</xs:group>
Next, this doesn't work because outputValueCalc is not allowed on optional
elements:
<xs:group name="padding7Bits">
<xs:sequence>
<xs:element name="bit0" minOccurs="0" dfdl:occursCountKind="implicit"
type="unsignedint1" dfdl:outputValueCalc="{0}" />
<xs:element name="bit1" minOccurs="0" dfdl:occursCountKind="implicit"
type="unsignedint1" dfdl:outputValueCalc="{0}" />
<xs:element name="bit2" minOccurs="0" dfdl:occursCountKind="implicit"
type="unsignedint1" dfdl:outputValueCalc="{0}" />
<xs:element name="bit3" minOccurs="0" dfdl:occursCountKind="implicit"
type="unsignedint1" dfdl:outputValueCalc="{0}" />
<xs:element name="bit4" minOccurs="0" dfdl:occursCountKind="implicit"
type="unsignedint1" dfdl:outputValueCalc="{0}" />
<xs:element name="bit5" minOccurs="0" dfdl:occursCountKind="implicit"
type="unsignedint1" dfdl:outputValueCalc="{0}" />
<xs:element name="bit6" minOccurs="0" dfdl:occursCountKind="implicit"
type="unsignedint1" dfdl:outputValueCalc="{0}" />
</xs:sequence>
</xs:group>
So, how do I declare the hidden group?
/Roger