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

Ambiguity in DFDL expressions when same element appears in sequence

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.0.0
    • Front End, General
    • None

    Description

      Say we have something like this:

      <group name="hg">
        <element name="foo" />
      </group>
      
      <element name="bar" >
        <sequence>
          <sequence dfdl:hiddenGroupRef="hg" />
          <element name="baz" dfdl:inputValueCalc="{ ../foo * 2 }" />
          <sequence dfdl:hiddenGroupRef="hg" />
          <element name="baz" dfdl:inputValueCalc="{ ../foo * 3 }" />
          <sequence dfdl:hiddenGroupRef="hg" />
          <element name="baz" dfdl:inputValueCalc="{ ../foo * 4 }" />
        </sequence>
      </element>
      

      The ../foo expression causes an ambiguity because it does not know which foo element inside the sequence to access. Right now, it looks like it just always selects the first element. Instead, we should throw an error. In some cases we may be able to support something like ../foo[2], but if any elements are optional that wouldn't work because we couldn't statically determine which foo to access.

      Attachments

        Activity

          People

            dfthompson Dave Thompson
            slawrence Steve Lawrence
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - Not Specified
                Not Specified
                Logged:
                Time Spent - 13m
                13m