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/03/01 18:41:49 UTC

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

mbeckerle commented on code in PR #975:
URL: https://github.com/apache/daffodil/pull/975#discussion_r1122164394


##########
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:
   Need to check that the annotation is specifically an appinfo annotation with source="http://www.ogf.org/dfdl/".
   Those should create the warning.
   
   You might want to tolerate not a perfect match on the source URI. 
   
   See annotatedSchemaComponent.scala
   
   Look for ``` lazy val dfdlAppInfos = { ... ``` for this logic.
   
   The common logic for finding a DFDL appinfo, tolerating small imperfections in the URI, should be shared between here and there. I'd suggest the common code belongs in XMLUtils, called from both places. 
   



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