You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@daffodil.apache.org by "Costello, Roger L." <co...@mitre.org> on 2019/03/03 12:55:04 UTC
Need help informing Daffodil that we're finished with this field and
it's time to build the next field
Hello DFDL community,
In the Windows EXE file format there is one or more Import_Lookup_Tables followed by a Hint_Name_Table. I am struggling with how to inform Daffodil, "Hey Daffodil, the input is finished with the Import_Lookup_Tables, now it's time to build the Hint_Name_Table." I am hoping you can show me how to inform Daffodil of this.
Each Import_Lookup_Table consists of one of more 32-bit fields, terminated by a 32-bit field containing all nulls.
The Hint_Name_Table consists of one of more entries; each entry consists of a 2-byte address, followed by a null-terminated name, followed by an optional null (to align to a 2-byte boundary).
Here is a graphic that illustrates the Import_Lookup_Tables followed by the Hint_Name_Table:
[cid:image002.png@01D4D196.68466350]
Here is the relevant portion of my DFDL schema:
<xs:element name="idata_Section">
<xs:complexType>
<xs:sequence>>
<xs:element ref="Import_Lookup_Table"
maxOccurs="unbounded" />
<xs:element ref="Hint_Name_Table" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Import_Lookup_Table">
<xs:complexType>
<xs:sequence>
<xs:element ref="Lookup_Table_Entry"
maxOccurs="unbounded" />
<xs:element name="Null_Lookup_Table_Entry"
type="xs:hexBinary"
dfdl:lengthKind="explicit"
dfdl:length="4"
dfdl:lengthUnits="bytes">
<xs:annotation>
<xs:appinfo source="http://www.ogf.org/dfdl/">
<dfdl:assert>
{ . eq xs:hexBinary("00000000") }
</dfdl:assert>
</xs:appinfo>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
How do I inform Daffodil that the input has finished with the Import_Lookup_Tables?
/Roger
Re: Need help informing Daffodil that we're finished with this field
and it's time to build the next field
Posted by Steve Lawrence <sl...@apache.org>.
I think we need more information, specifically how do you know what is
the last Import_Lookup_Table?
Within an Import_Lookup_Table you say that the Lookup_Table_Entry ends
with the last entry is all nulls, but that doesn't tell us where the
last Import_Lookup_Table is. Is it when there's a special value of a
Lookup_Table_Entry? Or maybe when the Import_Lookup_table has a no
Lookup_Table_Entires and just has the terminating Null? Something else?
You'll likely need to add a discriminator somewhere, but we'd need more
information to know what that discriminator should be.
- Steve
On 3/3/19 7:55 AM, Costello, Roger L. wrote:
> Hello DFDL community,
>
> In the Windows EXE file format there is one or more Import_Lookup_Tables
> followed by a Hint_Name_Table. I am struggling with how to inform Daffodil, “Hey
> Daffodil, the input is finished with the Import_Lookup_Tables, now it’s time to
> build the Hint_Name_Table.” I am hoping you can show me how to inform Daffodil
> of this.
>
> Each Import_Lookup_Table consists of one of more 32-bit fields, terminated by a
> 32-bit field containing all nulls.
>
> The Hint_Name_Table consists of one of more entries; each entry consists of a
> 2-byte address, followed by a null-terminated name, followed by an optional null
> (to align to a 2-byte boundary).
>
> Here is a graphic that illustrates the Import_Lookup_Tables followed by the
> Hint_Name_Table:
>
> Here is the relevant portion of my DFDL schema:
>
> <xs:elementname="idata_Section">
> <xs:complexType>
> <xs:sequence>>
> <xs:elementref="Import_Lookup_Table"
> maxOccurs="unbounded"/>
> <xs:elementref="Hint_Name_Table"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
>
> <xs:elementname="Import_Lookup_Table">
> <xs:complexType>
> <xs:sequence>
> <xs:elementref="Lookup_Table_Entry"
> maxOccurs="unbounded"/>
> <xs:elementname="Null_Lookup_Table_Entry"
> type="xs:hexBinary"
> dfdl:lengthKind="explicit"
> dfdl:length="4"
> dfdl:lengthUnits="bytes">
> <xs:annotation>
> <xs:appinfosource="http://www.ogf.org/dfdl/">
> <dfdl:assert>
> { . eq xs:hexBinary("00000000") }
> </dfdl:assert>
> </xs:appinfo>
> </xs:annotation>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
>
> How do I inform Daffodil that the input has finished with the Import_Lookup_Tables?
>
> /Roger
>