Shashi Ramaka created DAFFODIL-2205:
---------------------------------------
Summary: 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
Fix For: 2.5.0
Attachments: bug01-input-fails.txt, bug01-input-works.txt,
bug01.dfdl.xsd
>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)