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:
[email protected]


With regards,
Apache Git Services

Reply via email to