Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
3.2.1
-
None
-
None
Description
Consider this:
<dfdl:format ... lengthKind="implicit".../> <element name="seconds" type="tns:second" dfdl:lengthKind="explicit" dfdl:length="6" dfdl:lengthUnits="bits" dfdl:alignment="1" dfdl:alignmentUnits="bits"/> <simpleType name="second"> <union> <simpleType> <restriction base="tns:checkedInt"> <maxInclusive value="59"/> </restriction> </simpleType> <simpleType> <restriction base="tns:checkedInt"> <enumeration value="63"/> </restriction> </simpleType> </union> </simpleType>
The above, the parser ends up going for a 32-bit integer, when the intention is for it to parse a 6 bit integer.
This, however, works:
<element name="seconds" type="tns:second" dfdl:lengthUnits="bits" dfdl:alignment="1" dfdl:alignmentUnits="bits"/> <simpleType name="second" dfdl:lengthKind="explicit" dfdl:length="6"> <union> <simpleType> <restriction base="tns:checkedInt"> <maxInclusive value="59"/> </restriction> </simpleType> <simpleType> <restriction base="tns:checkedInt"> <enumeration value="63"/> </restriction> </simpleType> </union> </simpleType>
So it seems that the combining of properties when the type is a union does not propagate the element's properties and combine them with the properties on each of the union types. Rather, the simpleType ends up ignoring the element's properties which specify explicit length of 6 bits, and instead takes the default format length of 32 (because this is a xs:unsignedInt ultimately).