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

Ambiguity in DFDL expressions when same element appears in sequence

XMLWordPrintableJSON

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 2.0.0
    • None
    • Front End, General
    • None

      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.

              dthompson David Thompson
              slawrence Steve Lawrence
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:

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