Hello DFDL community,

My input contains a string that is prefixed by a number which indicates the 
length of the string, e.g.,

8John Doe

The string may be anywhere from 0 characters to 999 characters. The below DFDL 
schema only allows a single digit for the prefix number 
(dfdl:lengthKind="explicit" dfdl:length="1"). How do I design the schema to 
allow the prefix number to be any number from 0 to 999?  /Roger

<xs:element name="input">
    <xs:complexType>
        <xs:sequence>
            <xs:element name="name" type="xs:string"
                        dfdl:lengthKind="prefixed"
                        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>

Reply via email to