Hello DFDL community,

My input file contains a bunch of Import Directory Entries. The last Entry is 
empty (filled with null values). I figured that the way to handle this is with 
a lengthPattern (see below), but that results in this error message:

[error] Schema Definition Error: Element element reference 
{}Import_Directory_Entry does not meet the requirements of Pattern-Based 
lengths and Scanability.

What is the right way to express this?  /Roger

<xs:element name="Import_Directory_Table">
    <xs:complexType>
        <xs:sequence>
            <xs:element ref="Import_Directory_Entry" maxOccurs="unbounded"
                dfdl:lengthKind="pattern" dfdl:lengthUnits="bytes"
                dfdl:lengthPattern=".+?(?=((\x00){20,20}|$))" />
        </xs:sequence>
    </xs:complexType>
</xs:element>

<xs:element name="Import_Directory_Entry">
    <xs:complexType>
        <xs:sequence>
            <xs:element name="Import_Lookup_Table_RVA" type="addressType" />
            <xs:element name="Date_Time_Stamp" type="xs:dateTime" 
dfdl:length="4"
                dfdl:lengthKind="explicit" 
dfdl:binaryCalendarRep="binarySeconds"
                dfdl:lengthUnits="bytes" 
dfdl:binaryCalendarEpoch="1970-01-01T00:00:00" />
            <xs:element name="Forwarder_Chain" type="unsignedint32" />
            <xs:element name="Name_RVA" type="addressType" />
            <xs:element name="Import_Address_Table_RVA" type="addressType" />
        </xs:sequence>
    </xs:complexType>
</xs:element>

Reply via email to