Hi Folks,
My input is this:
8John Doe
I used lengthKind=prefixed in my schema. See below. Notice on the element
declaration for "name" I specify dfdl:lengthUnits="bytes". I originally
specified "characters" instead of "bytes" and that resulted in an error
(unconsumed data). This is so counterintuitive. First, why do I even need to
specify lengthUnits on "name"? Second, although I don't' show it, I tried
putting lengthUnits on the simpleType and it didn't matter what value I
assigned to lengthUnits ... I thought you always had to specify lengthUnits
whenever you specify lengthKind=explicit ... apparently not. I couldn't find
any explanation of this in the specification. /Roger
<xs:element name="input">
<xs:complexType>
<xs:sequence>
<xs:element name="name"
type="xs:string"
dfdl:lengthKind="prefixed"
dfdl:lengthUnits="bytes"
dfdl:prefixLengthType="prefix-type"
dfdl:prefixIncludesPrefixLength="no"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:simpleType name="prefix-type"
dfdl:lengthKind="explicit"
dfdl:length="1">
<xs:restriction base="xs:integer" />
</xs:simpleType>