Hi Folks,

I need my DFDL to look-ahead:

The decimal value of the first bit of the input should be wrapped in an <A> tag 
if the decimal value of the next 4 bits equals 7 and the decimal value of the 4 
bits after that equals 9, or the decimal value of the next 4 bits equals 7 and 
the decimal value of the 4 bits after that equals 10, otherwise the first bit 
of the input should be wrapped in a <B> tag.

Below is my attempt at implementing this. Daffodil gives this warning message:

Schema Definition Warning: Counterintuitive placement detected. Wrap the 
discriminator or assert in an empty sequence to evaluate before the contents. 
(id: discouragedDiscriminatorPlacement)

Here is my DFDL:

<xs:element name="test">
    <xs:complexType>
        <xs:sequence>
            <xs:choice>
                <xs:sequence> 
                    <xs:annotation>
                        <xs:appinfo source="http://www.ogf.org/dfdl/";>
                            <dfdl:discriminator testKind="pattern" 
testPattern="(.x7x9)|(.x7xA)" />
                        </xs:appinfo>
                    </xs:annotation>
                    <xs:element name='A' type="unsignedint1"/>
                </xs:sequence>
                <xs:sequence> 
                    <xs:element name='B' type="unsignedint1"/>
                </xs:sequence>
            </xs:choice>
            <xs:element name='C' type="unsignedint4"/>
            <xs:element name='D' type="unsignedint4"/>
        </xs:sequence>
    </xs:complexType>
</xs:element>

Reply via email to