You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "Olabusayo Kilo (Jira)" <ji...@apache.org> on 2022/10/09 14:09:00 UTC

[jira] [Updated] (DAFFODIL-2738) dfdlx:repType's incorrect handling of Binary Long to String enumerations

     [ https://issues.apache.org/jira/browse/DAFFODIL-2738?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Olabusayo Kilo updated DAFFODIL-2738:
-------------------------------------
    Description: 
This is part of a large schema project. So link access to the schema project will follow in a different comment.

But a short synopsis is when the repType of an element in a binary data format is an unsignedlong, the repType is ignored in favor of treating the element like a string type.

For example:
{code:xml}
 
  <xs:element name="a" type="tns:jobEnum"/>

  <simpleType name="jobEnum" dfdlx:repType="xs:enum4">
    <restriction base="xs:string">
      <enumeration value="CTO" dfdlx:repValues="1"/>
      <enumeration value="MANAGER" dfdlx:repValues="2"/>
      <enumeration value="TEAM_LEAD" dfdlx:repValues="3"/>
    </restriction>
  </simpleType>

  <xs:simpleType name="enum4" dfdl:length="4" dfdl:lengthKind="explicit" dfld:lengthUnit="bits">
    <xs:restriction base="xs:unsignedLong"/>
  </xs:simpleType>
{code}
 

Would result in the following trace

<Element name='a'><SpecifiedLengthExplicitParser><a parser='StringOfSpecifiedLengthParser' /></SpecifiedLengthExplicitParser><AssertExpressionEvaluationParser/></Element>

rather than

<Element name='a'><SpecifiedLengthExplicitParser><a parser='Binary*SpecifiedLengthParser' /></SpecifiedLengthExplicitParser><AssertExpressionEvaluationParser/></Element>

Unfortunately the workaround mentioned in https://issues.apache.org/jira/browse/DAFFODIL-2596?focusedCommentId=17475017&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17475017, won't work for our usecase because the data is binary and has no delimiters.

  was:
This is part of a large schema project. So link access to the schema project will follow in a different comment.

But a short synopsis is when the repType of an element in a binary data format is an unsignedlong, the repType is ignored in favor of treating the element like a string type.

For example:

  <xs:element name="a" type="tns:jobEnum"/>


  <simpleType name="jobEnum" dfdlx:repType="xs:enum4">
    <restriction base="xs:string">
      <enumeration value="CTO" dfdlx:repValues="1"/>
      <enumeration value="MANAGER" dfdlx:repValues="2"/>
      <enumeration value="TEAM_LEAD" dfdlx:repValues="3"/>
    </restriction>
  </simpleType>

  <xs:simpleType name="enum4" dfdl:length="4" dfdl:lengthKind="explicit" dfld:lengthUnit="bits">
    <xs:restriction base="xs:unsignedLong"/>
  </xs:simpleType>


Would result in the following trace


<Element name='a'><SpecifiedLengthExplicitParser><a parser='StringOfSpecifiedLengthParser' /></SpecifiedLengthExplicitParser><AssertExpressionEvaluationParser/></Element>

rather than

<Element name='a'><SpecifiedLengthExplicitParser><a parser='Binary*SpecifiedLengthParser' /></SpecifiedLengthExplicitParser><AssertExpressionEvaluationParser/></Element>


Unfortunately the workaround mentioned in https://issues.apache.org/jira/browse/DAFFODIL-2596?focusedCommentId=17475017&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17475017, won't work for our usecase because the data is binary and has no delimiters.


> dfdlx:repType's incorrect handling of Binary Long to String enumerations
> ------------------------------------------------------------------------
>
>                 Key: DAFFODIL-2738
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2738
>             Project: Daffodil
>          Issue Type: Bug
>          Components: Back End
>    Affects Versions: 3.3.0
>            Reporter: Olabusayo Kilo
>            Priority: Major
>             Fix For: 3.4.0
>
>
> This is part of a large schema project. So link access to the schema project will follow in a different comment.
> But a short synopsis is when the repType of an element in a binary data format is an unsignedlong, the repType is ignored in favor of treating the element like a string type.
> For example:
> {code:xml}
>  
>   <xs:element name="a" type="tns:jobEnum"/>
>   <simpleType name="jobEnum" dfdlx:repType="xs:enum4">
>     <restriction base="xs:string">
>       <enumeration value="CTO" dfdlx:repValues="1"/>
>       <enumeration value="MANAGER" dfdlx:repValues="2"/>
>       <enumeration value="TEAM_LEAD" dfdlx:repValues="3"/>
>     </restriction>
>   </simpleType>
>   <xs:simpleType name="enum4" dfdl:length="4" dfdl:lengthKind="explicit" dfld:lengthUnit="bits">
>     <xs:restriction base="xs:unsignedLong"/>
>   </xs:simpleType>
> {code}
>  
> Would result in the following trace
> <Element name='a'><SpecifiedLengthExplicitParser><a parser='StringOfSpecifiedLengthParser' /></SpecifiedLengthExplicitParser><AssertExpressionEvaluationParser/></Element>
> rather than
> <Element name='a'><SpecifiedLengthExplicitParser><a parser='Binary*SpecifiedLengthParser' /></SpecifiedLengthExplicitParser><AssertExpressionEvaluationParser/></Element>
> Unfortunately the workaround mentioned in https://issues.apache.org/jira/browse/DAFFODIL-2596?focusedCommentId=17475017&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17475017, won't work for our usecase because the data is binary and has no delimiters.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)