stevedlawrence commented on a change in pull request #230: Enable schema 
validation of attribute- and short-form properties
URL: https://github.com/apache/incubator-daffodil/pull/230#discussion_r291975690
 
 

 ##########
 File path: 
daffodil-propgen/src/main/resources/org/apache/daffodil/xsd/DFDL_part2_attributes.xsd
 ##########
 @@ -33,6 +33,24 @@
 
   <xsd:attribute name="ref" type="xsd:QName" />
 
+  <!--
+    This attribute group allows for any attribute not in the dfdl namesapce.
+    Attributes in the dfdl namespae will be strictly validated.
+  -->
+  <xsd:attributeGroup name="anyOther">
+    <xsd:anyAttribute namespace="##other" processContents="lax" />
+  </xsd:attributeGroup>
+
+  <!--
+    This group allows for any element not in the dfdl namesapce.
+    Elments in the dfdl namespae will be strictly validated.
+  -->
 
 Review comment:
   It's a combination of a few things. First, this anyAttribute is in a file 
that has the targetNamespace set to the ``dfdl`` namespace. The 
``namespace="##other"" attribte says that any attribute will be allowed if it 
is not in that targetNamespace. And the ``processContext="lax"`` says that for 
those attributes that will be allowed, they should be validated if a schema can 
be found ffor them, but otherwise they'll just be allowed.
   
   So the net effect of this is that when something references dfdl:anyOther, 
it will allow and lax-ly validate attributes that are NOT in the dfdl namespace.
   
   But your right that this in itself doesn't enable strict validation of DFDL 
attributes, so I'll update the comment.
   
   The thing that enables strict validation is where this is referenced. The 
places where dfdl:anyOther is referenced additionally define specific 
attributes in the dfdl namespace. So the schema allows either a bunch of stuff 
explicitly allowed and strictly validated (normal schema validation) OR it 
allows anytthing not in the dfdl namespace. 
   
   I'll update this comment to make it more clear how this works and should be 
used.

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