You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@daffodil.apache.org by GitBox <gi...@apache.org> on 2019/06/19 16:01:37 UTC

[GitHub] [incubator-daffodil] mbeckerle commented on a change in pull request #235: Daffodil 2143 2154 initiated content and nillable EDIFACT Bugs

mbeckerle commented on a change in pull request #235: Daffodil 2143  2154 initiated content and nillable EDIFACT Bugs
URL: https://github.com/apache/incubator-daffodil/pull/235#discussion_r295379421
 
 

 ##########
 File path: daffodil-core/src/main/scala/org/apache/daffodil/dsom/InitiatedTerminatedMixin.scala
 ##########
 @@ -61,7 +64,23 @@ trait InitiatedTerminatedMixin
     res
   }
 
-  private lazy val initiatorDiscriminator = prod("initiatorDiscriminator", parentSaysInitiatedContent) { InitiatedContent(this) }
+  private lazy val initiatorDiscriminator = prod(
+    "initiatorDiscriminator",
+    parentSaysInitiatedContent &&
+      immediatelyEnclosingModelGroup.map {
+        case c: ChoiceTermBase => true
+        case s: SequenceTermBase => (isArray || isOptional) &&
+          isVariableOccurrences
+      }.getOrElse(false)) {
+      this match {
+        case eb: ElementBase => {
+          if (eb.minOccurs < 1)
+            SDW(WarnID.InitiatedContentMinOccursZero, "The minOccurs attribute should not be zero when dfdl:initiatedContent is 'yes'.")
 
 Review comment:
   Yes. I'll add comments. I made this an SDW because making it an SDE breaks EDIFACT, possibly other schemas.
   I will add a JIRA ticket to add tunable for this to control SDE/SDW. 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services