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

Choice ambiguous element name results in failed expression

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.1.0
    • Middle "End"
    • 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.

      ��

      Attachments

        Activity

          People

            dfthompson Dave Thompson
            mbeckerle Mike Beckerle
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: