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

dfdl:valueLength on child element returns unexpected Result

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.2.1
    • 3.3.0
    • Back End, General
    • None

    Description

      dfdl:valueLength returns the incorrect result for a child element. Sometimes it returns the value of the entire containing element (i.e root element), sometimes it just returns the value of the neighbor element. Attached are some files to demonstrate this issue

       

      The data in the test correspond to these infosets:

      correct_message:

        <exSchema:exSchema_message xmlns:exSchema="urn:exSchema:1.0">
          <framing_header>
            <message_size>7</message_size>
          </framing_header>
          <message>
            <content>620100</content>
          </message>
        </exSchema:exSchema_message> 

       
      msg_size_smaller_than_file_size:

        <exSchema:exSchema_message xmlns:exSchema="urn:exSchema:1.0">
          <framing_header>
            <message_size>4</message_size>
          </framing_header>
          <message>
            <content>620100</content>
          </message>
        </exSchema:exSchema_message> 

      The first TDML fails with this message:

      Content size (7) and the difference of message_size and framing_header size (3) should be equal
      

      The second:

      Content size (4) and the difference of message_size and framing_header size (0) should be equal
      

      The first should not fail, and the 2nd should fail on a "Left over data" error. Commenting out the assertion annotation will show 2 passing tests.

      Attachments

        1. exSchema.dfdl.xsd
          3 kB
          Olabusayo Kilo
        2. exSchema.tdml
          3 kB
          Olabusayo Kilo
        3. TestExSchema.scala
          1 kB
          Olabusayo Kilo

        Activity

          People

            slawrence Steve Lawrence
            okilo@tresys.com Olabusayo Kilo
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: