Hi Folks,

I have a binary file. It has a choice of 2-byte "markers". The last 2 bytes in 
the file must be FF D9.

One of the markers is FF E1. To see if my approach works, I created a choice 
for marker FF E1 and nothing else. I placed that choice within another choice 
which has an element that gobbles up all the remaining bytes except for the 
last 2 bytes. Here is my choice within a choice:

<xs:choice>
    <xs:choice>
            <xs:element name="APP1" type="xs:hexBinary" 
                dfdl:lengthKind="pattern"
                dfdl:lengthPattern="\xFF\xE1"
                dfdl:lengthUnits="bytes"
            />
    </xs:choice>
    <xs:element name="Bytes" type="xs:hexBinary" 
        dfdl:lengthKind="pattern"
        dfdl:lengthPattern="[\x00-\xFF]+?(?=\xFF\xD9$)"
        dfdl:lengthUnits="bytes"
    />
</xs:choice>

When I run it, Daffodil reports "Left over data." Daffodil consumed FF E1 and 
then stopped. Any thoughts on what I'm doing wrong?

/Roger

Reply via email to