Hello DFDL community,

The data specification for my input file says this:
Data Exchange
Data sending order - Little Endian (Intel standard). LSByte first, LSBit first.

I think that means: for a 16-bit unsigned integer the number one ( 1 ) is 
represented this way:

1000 0000 0000 0000

The "1" is the LSBit in the LSByte ... do you agree?

How to specify the DFDL properties for this file format?

I discovered that this isn't correct:

<xs:element name="input">
    <xs:complexType>
        <xs:sequence>
            <xs:element name="two-byte-integer" type="unsignedint16"
                dfdl:byteOrder="littleEndian"
                dfdl:bitOrder="leastSignificantBitFirst"/>
        </xs:sequence>
    </xs:complexType>
</xs:element>
As it generates the wrong value:

<input>
  <two-byte-integer>128</two-byte-integer>
</input>

Eek!

It seems that I will have to create a hidden group which places each bit into a 
different element. Then, create an element which uses inputValueCalc to reverse 
the bytes and then reverse the bits in each byte and then concatenate the bits 
and then cast to unsignedInt ... is that correct? Eek! That's a lot of work. Is 
there a simpler solution?

/Roger

Reply via email to