You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@daffodil.apache.org by "Shashi Ramaka (Jira)" <ji...@apache.org> on 2019/09/18 22:32:00 UTC
[jira] [Updated] (DAFFODIL-2205) emptyValueDelimiterPolicy does not
work per specification for 'none'
[ https://issues.apache.org/jira/browse/DAFFODIL-2205?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Shashi Ramaka updated DAFFODIL-2205:
------------------------------------
Description:
This bug report is based on a message Roger Costello posted to the Daffodil Users group.
From the DFDL specification, when emptyValueDelimiterPolicy is set to 'none':
{quote}'none' indicates that if the content region is empty neither the
dfdl:initiator or dfdl:terminator must be present. On unparsing when
the content region is empty nothing will be output.
{quote}
Based on the above, if in the schema an element has an initiator and a terminator, and if the emptyValueDelimiterPolicy is set to 'none', to represent an empty value neither the initiator nor the terminator should be present in the input.
In the attached test case,
* the element *MiddleName* has an initiator and a terminator
* *emptyValueDelimiterPolicy* is set to 'none'
* For the test input, John,,Doe we are getting the parse error: [error] Parse Error: Found out of scope delimiter: ',' ','
* Test input John,(),Doe parses successfully
{code:xml}
<xs:element name="input">
<xs:complexType>
<xs:sequence
dfdl:separator=","
dfdl:separatorPosition="infix"
dfdl:separatorSuppressionPolicy="trailingEmpty">
<xs:element
name="FirstName"
type="xs:string" />
<xs:element
name="MiddleName"
type="xs:string"
dfdl:initiator="("
dfdl:terminator=")"
dfdlx:emptyElementParsePolicy="treatAsEmpty"
dfdl:emptyValueDelimiterPolicy="initiator" />
<xs:element
name="LastName"
type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
{code}
Input:
John,(),Doe – parse successful
John,,Doe – Parse error.
[error] Parse Error: Found out of scope delimiter: ',' ','
The files used for testing this scenario are attached.
was:
From the DFDL specification, when emptyValueDelimiterPolicy is set to 'none':
{quote}'none' indicates that if the content region is empty neither the
dfdl:initiator or dfdl:terminator must be present. On unparsing when
the content region is empty nothing will be output.
{quote}
Based on the above, if in the schema an element has an initiator and a terminator, and if the emptyValueDelimiterPolicy is set to 'none', to represent an empty value neither the initiator nor the terminator should be present in the input.
In the attached test case,
* the element *MiddleName* has an initiator and a terminator
* *emptyValueDelimiterPolicy* is set to 'none'
* For the test input, John,,Doe we are getting the parse error: [error] Parse Error: Found out of scope delimiter: ',' ','
* Test input John,(),Doe parses successfully
{code:xml}
<xs:element name="input">
<xs:complexType>
<xs:sequence
dfdl:separator=","
dfdl:separatorPosition="infix"
dfdl:separatorSuppressionPolicy="trailingEmpty">
<xs:element
name="FirstName"
type="xs:string" />
<xs:element
name="MiddleName"
type="xs:string"
dfdl:initiator="("
dfdl:terminator=")"
dfdlx:emptyElementParsePolicy="treatAsEmpty"
dfdl:emptyValueDelimiterPolicy="initiator" />
<xs:element
name="LastName"
type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
{code}
Input:
John,(),Doe -- parse successful
John,,Doe -- Parse error.
[error] Parse Error: Found out of scope delimiter: ',' ','
The files used for testing this scenario are attached.
> emptyValueDelimiterPolicy does not work per specification for 'none'
> ---------------------------------------------------------------------
>
> Key: DAFFODIL-2205
> URL: https://issues.apache.org/jira/browse/DAFFODIL-2205
> Project: Daffodil
> Issue Type: Bug
> Affects Versions: 2.4.0
> Environment: Daffodil 2.4 on Windows 10
> Reporter: Shashi Ramaka
> Priority: Major
> Fix For: 2.5.0
>
> Attachments: bug01-input-fails.txt, bug01-input-works.txt, bug01.dfdl.xsd
>
>
> This bug report is based on a message Roger Costello posted to the Daffodil Users group.
> From the DFDL specification, when emptyValueDelimiterPolicy is set to 'none':
> {quote}'none' indicates that if the content region is empty neither the
> dfdl:initiator or dfdl:terminator must be present. On unparsing when
> the content region is empty nothing will be output.
> {quote}
> Based on the above, if in the schema an element has an initiator and a terminator, and if the emptyValueDelimiterPolicy is set to 'none', to represent an empty value neither the initiator nor the terminator should be present in the input.
> In the attached test case,
> * the element *MiddleName* has an initiator and a terminator
> * *emptyValueDelimiterPolicy* is set to 'none'
> * For the test input, John,,Doe we are getting the parse error: [error] Parse Error: Found out of scope delimiter: ',' ','
> * Test input John,(),Doe parses successfully
> {code:xml}
> <xs:element name="input">
> <xs:complexType>
> <xs:sequence
> dfdl:separator=","
> dfdl:separatorPosition="infix"
> dfdl:separatorSuppressionPolicy="trailingEmpty">
> <xs:element
> name="FirstName"
> type="xs:string" />
> <xs:element
> name="MiddleName"
> type="xs:string"
> dfdl:initiator="("
> dfdl:terminator=")"
> dfdlx:emptyElementParsePolicy="treatAsEmpty"
> dfdl:emptyValueDelimiterPolicy="initiator" />
> <xs:element
> name="LastName"
> type="xs:string" />
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> {code}
>
> Input:
> John,(),Doe – parse successful
> John,,Doe – Parse error.
> [error] Parse Error: Found out of scope delimiter: ',' ','
>
> The files used for testing this scenario are attached.
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)