Uploaded image for project: 'Daffodil'
  1. Daffodil
  2. DAFFODIL-2110

Cannot change bitorder mid schema

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 2.4.0
    • 2.4.0
    • Back End
    • None

    Description

      Setting the bitOrder in the middle of a schema appears to have no effect.

      Consider the following schema:

      <xs:element name="changeOnSequence" dfdl:lengthKind='implicit'>
      <xs:complexType>
      <xs:sequence>
      <xs:sequence dfdl:bitOrder="mostSignificantBitFirst">
      <xs:element name="A" type="xs:unsignedInt" dfdl:length="8"/>
      <xs:element name="B" type="xs:unsignedInt" dfdl:length="8"/>
      </xs:sequence>
      <xs:sequence dfdl:bitOrder="leastSignificantBitFirst" dfdl:byteOrder="littleEndian">
      <xs:element name="C" type="xs:unsignedInt" dfdl:length="8" dfdl:bitOrder="leastSignificantBitFirst" dfdl:byteOrder="littleEndian"/>
      <xs:element name="D" type="xs:unsignedInt" dfdl:length="8"/>
      </xs:sequence>
      </xs:sequence>
      </xs:complexType>
      </xs:element>

      With the following test:

      <tdml:parserTestCase name="bitOrderChangeOnSequence"
      root="changeOnSequence" model="s6" description="Tests changing bitOrder when on a byte boundary.">
      <document xmlns="http://www.ibm.com/xmlns/dfdl/testData">
      <documentPart type="bits">
      0000 0001
      0000 0001
      1000 0000
      1000 0000
      </documentPart>
      </document>
      <tdml:infoset>
      <tdml:dfdlInfoset xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://example.com">
      <changeOnSequence>
      <A>1</A>
      <B>1</B>
      <C>1</C>
      <D>1</D>
      </changeOnSequence>
      </tdml:dfdlInfoset>
      </tdml:infoset>
      </tdml:parserTestCase>

      (both snippets are in attached tdml as test name bitOrderChangeOnSequence. The attached TDML is an uncommited modified version of section05/simple_types/BitOrder.tdml )

      The actual result of parsing is:

      <changeOnSequence>

      <A>1</A>

      <B>1</B>

      <C>128</C>

      <D>128</D>

      </changeOnSequence>

      Note that the above schema attempts to change the bit order in 2 different ways:

      1) On a sequence, and

      2) On an element itself.

      Neither approach has any results.

      A possibly related issue is that ommiting the dfdl:byteOrder="littleEndian" on the xs:element results in an SDE, despite the fact that such is set on the enclosing sequence.

      Attachments

        1. BitOrder.tdml
          31 kB
          Brandon Sloane

        Activity

          People

            Unassigned Unassigned
            brandon.sloane Brandon Sloane
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: