[
https://issues.apache.org/jira/browse/DAFFODIL-1773?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Michael Beckerle reassigned DAFFODIL-1773:
------------------------------------------
Assignee: Michael Beckerle
> Choice ambiguous element name results in failed expression
> ----------------------------------------------------------
>
> Key: DAFFODIL-1773
> URL: https://issues.apache.org/jira/browse/DAFFODIL-1773
> Project: Daffodil
> Issue Type: Bug
> Components: Middle "End"
> Reporter: Michael Beckerle
> Assignee: Michael Beckerle
> Fix For: 2.1.0
>
>
> (Bug found in Link16 work. Reproduced in tests test_choiceSlotAmbiguous1 and
> test_choiceSlotAmbiguous2)
> Consider this choice:
> {code:java}
> <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>{code}
> 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.
> ��
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)