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/08/28 11:28:00 UTC
[jira] [Created] (DAFFODIL-2193) dfdl:lengthKind="prefixed" with
dfdl:lengthUnits="characters" gives wrong parse result
Steve Lawrence created DAFFODIL-2193:
----------------------------------------
Summary: dfdl:lengthKind="prefixed" with dfdl:lengthUnits="characters" gives wrong parse result
Key: DAFFODIL-2193
URL: https://issues.apache.org/jira/browse/DAFFODIL-2193
Project: Daffodil
Issue Type: Bug
Components: Back End, Front End
Affects Versions: 2.4.0
Reporter: Steve Lawrence
Fix For: 2.5.0
{code}
3ABC
{code}
That data can be described with the following schema:
{code:xsd}
<xs:element name="D"type="xs:string"
dfdl:lengthUnits="characters"
dfdl:lengthKind="prefixed"
dfdl:prefixLengthType="D-type"
dfdl:prefixIncludesPrefixLength="no"/>
<xs:simpleType name="D-type"
dfdl:lengthKind="explicit"
dfdl:length="1">
<xs:restrictionbase="xs:integer"/>
</xs:simpleType>
{code}
DAFFODIL-114 added support for lengthKind="characters", but upon testing it looks like it created an Assert.invariant if the lengthKind="characters" for a prefixed length element. On 2.4.0, that invariant doesn't happen, but the lenght is calculated incorrectly. In 2.4.0, it only parses a single character, even though the prefix length is 3.
Also see related DAFFODIL-2029, which is to add support for unparsing lengthKind="characters" prefixed length elements.
If we don't support this yet, we might just want to make it a notYetImplemented error.
--
This message was sent by Atlassian Jira
(v8.3.2#803003)