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

Choice ambiguous element name results in failed expression

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: deferred
    • Component/s: Middle "End"
    • Labels:
      None

      Description

      (Bug found in Link16 work. Reproduced in tests test_choiceSlotAmbiguous1 and test_choiceSlotAmbiguous2)

      Consider this choice:

       
      <xs:choice>
                      <xs:sequence>
                        <xs:element name="A" type="xs:string" dfdl:length="1" />
                        <xs:element name="C" type="xs:string" dfdl:length="1">
                          <xs:annotation>
                            <xs:appinfo source="http://www.ogf.org/dfdl">
                              <dfdl:discriminator>{ ../A eq "A" }</dfdl:discriminator>
                            </xs:appinfo>
                          </xs:annotation>
                        </xs:element>
                      </xs:sequence>
                      <xs:sequence>
                        <xs:element name="B" type="xs:string" dfdl:length="1" />
                        <xs:element name="C" type="xs:string" dfdl:length="1">
                          <xs:annotation>
                            <xs:appinfo source="http://www.ogf.org/dfdl">
                              <dfdl:discriminator>{ ../B eq "B" }</dfdl:discriminator>
                            </xs:appinfo>
                          </xs:annotation>
                        </xs:element>
                      </xs:sequence>
                    </xs:choice>

      Now imagine a subsequent expression containing ../C.

      Which C is that? The first or second. Answer is it depends on which discriminator was chosen.

      If the first discriminator is true, then the path ../C succeeds. If the second discriminator was true the path ../C fails with no such element C.

      This is probably due to Daffodil's schema compiler assigning two different slot numbers to these two C elements, rather than recognizing they have the same name+namespace and so using a single slot for them.

       

        Gliffy Diagrams

          Attachments

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              mbeckerle.dfdl Mike Beckerle
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:

                  Tasks

                  Progress: 
                   0/0