You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "mbeckerle (via GitHub)" <gi...@apache.org> on 2023/01/29 22:22:02 UTC
[GitHub] [daffodil] mbeckerle commented on a diff in pull request #938: Add test for separatorSuppressionPolicy='never' (WIP)
mbeckerle commented on code in PR #938:
URL: https://github.com/apache/daffodil/pull/938#discussion_r1090063576
##########
daffodil-test/src/test/resources/org/apache/daffodil/section14/sequence_groups/SequenceGroupDelimiters.tdml:
##########
@@ -614,4 +614,37 @@
</tdml:parserTestCase>
+ <tdml:defineSchema name="separatorSuppressionPolicy">
+
+ <xs:include schemaLocation="org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd"/>
+ <dfdl:format ref="ex:GeneralFormat" lengthKind="delimited" outputNewLine="%CR;%LF;"/>
+
+ <xs:element name="policyNever">
+ <xs:complexType>
+ <xs:sequence dfdl:separator="%NL;" dfdl:sequenceKind="ordered" dfdl:separatorSuppressionPolicy="never">
+ <xs:element name="A" type="xs:string" minOccurs="0" dfdl:occursCountKind="implicit" />
+ <xs:element name="B" type="xs:string" minOccurs="0" dfdl:occursCountKind="implicit" />
+ <xs:element name="C" type="xs:string" minOccurs="0" dfdl:occursCountKind="implicit" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ </tdml:defineSchema>
+
+ <tdml:parserTestCase name="separatorSuppressionPolicy_never" model="separatorSuppressionPolicy">
+ <tdml:document>
+ <tdml:documentPart type="text"
+ replaceDFDLEntities="true"><![CDATA[Hello%CR;%LF;world%CR;%LF;]]></tdml:documentPart>
+ </tdml:document>
+ <tdml:infoset>
+ <tdml:dfdlInfoset>
+ <tns:policyNever>
+ <tns:A>Hello</tns:A>
+ <tns:B>world</tns:B>
+ <tns:C></tns:C>
Review Comment:
The data looks correct.
The only issue is whether this C element should be here, or be removed because it's empty. That depends on property emptyElementParsePolicy. If that has value "treatAsEmpty" then this is the correct behavior. If "treatAsAbsent" then I think this element should not appear in the infoset.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org