You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@daffodil.apache.org by "Steve Lawrence (JIRA)" <ji...@apache.org> on 2019/06/24 17:58:00 UTC

[jira] [Commented] (DAFFODIL-2163) False warning about unused dfdl:choiceBranchKey on direct dispatch array

    [ https://issues.apache.org/jira/browse/DAFFODIL-2163?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16871561#comment-16871561 ] 

Steve Lawrence commented on DAFFODIL-2163:
------------------------------------------

Was able to create a minimal example that reproduces the issue, this appears to be a very special edge case that requires the following:
 # Choice with direct dispatch to an array
 # The array is a reference to an element in an included schema
 # The element contains a choice with direct dispatch

When this hapens, warnings are created saying the choiceDispatchKey and choiceBranchKey properties in the element are ignored. Testing shows that they are not ignored, so this must be a bug with what elements they are being cached on in this very specific scenario. Code to reproduce:

*root.xsd*

{code:xml}
  <xs:include schemaLocation="incl.xsd" />

  <xs:element name="Root">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="Key" type="xs:string" dfdl:length="1" dfdl:lengthKind="explicit" />
        <xs:choice dfdl:choiceDispatchKey="{ xs:string(./Key) }">
          <xs:element ref="ex:Array" dfdl:choiceBranchKey="1" minOccurs="2" maxOccurs="2" />
        </xs:choice>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
{code}

*incl.xsd*
{code:xml}
  <xs:element name="Array">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="Key" type="xs:int" dfdl:length="1" dfdl:lengthKind="explicit" />
        <xs:choice dfdl:choiceDispatchKey="{ xs:string(./Key) }">
          <xs:element name="One" type="xs:int" dfdl:length="1" dfdl:lengthKind="explicit" dfdl:choiceBranchKey="1" />
        </xs:choice>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
{code}


 

> False warning about unused dfdl:choiceBranchKey on direct dispatch array
> ------------------------------------------------------------------------
>
>                 Key: DAFFODIL-2163
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2163
>             Project: Daffodil
>          Issue Type: Bug
>          Components: Front End
>            Reporter: Steve Lawrence
>            Assignee: Steve Lawrence
>            Priority: Major
>             Fix For: 2.4.0
>
>
> This seems potentially related to DAFFODIL-2162. That issue was resolved, but it now results in a warning about dfdl:choiceBranchKey property is unused. The tests clearly show that direct dispatch works so the branch key isn't actually usnused. Perhaps the property is being cached on something that we aren't looking at to see which properties have been used, or the property is being used in a way that isn't caching at all.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)