You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "jadams-tresys (via GitHub)" <gi...@apache.org> on 2023/03/02 18:10:32 UTC

[GitHub] [daffodil] jadams-tresys commented on a diff in pull request #975: Warn when annotations placed on group definition

jadams-tresys commented on code in PR #975:
URL: https://github.com/apache/daffodil/pull/975#discussion_r1123529441


##########
daffodil-core/src/main/scala/org/apache/daffodil/core/dsom/GroupDef.scala:
##########
@@ -131,6 +133,15 @@ sealed abstract class GlobalGroupDef(
     }
   }
 
+  private def checkForGroupDefAnnotations(): Unit = {
+    // Ensure that the group definition itself does not have any annotations.
+    // Annotations should only be on group references or children of the group
+    // definition
+    val found = defXML.child.map(_.label).contains("annotation")

Review Comment:
   I've moved the logic to XMLUtils via a getDFDLAppinfos function.  However, it loses the ability to send schema definition warnings and I'm not sure what a good solution is to get that functionality back. Should there just be another pass through all the appinfos in AnnotatedSchemaComponent to issue warnings as needed?  I thought about having my function return a list of warnings in addition to the list of appinfos and then doing SDW's back in AnnotatedSchemaComponent, but it felt very hacky to have a function returning a tuple with a list containing a tuple for WarnID, String.



-- 
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