stevedlawrence opened a new pull request, #1582:
URL: https://github.com/apache/daffodil/pull/1582

   Section 8.1.4, Rule 5 of the DFDL specification describes the 
scoping/resolution of default properties, saying:
   
       Obtain applicable "default" properties from a dfdl:format annotation
       on the xs:schema that contains the component (if such annotation is
       present). Combine these with the current working set of "default"
       properties, the latter overriding the former (that is, inner wins).
       Result is a new working set of "default" properties.
   
   So if a schema component does not explicitly define a property, we should 
look for default properties on the innermost components first.
   
   But Daffodil currently does the reverse, looking at the default properties 
of the outermost components first. This happens because we build the default 
component property chain list recursively, prepending the outermost components 
default chain to the list. This means wen we scan for default values we look at 
the outermost chain first.
   
   The solution to this is to reverse the default component chain so that when 
we scan it for properties the innermost components appear first and are given 
precedence.
   
   Note that it is possible that some schemas unintentionally relied on this 
buggy behavior, and it can sometimes be very difficult to figure out which 
properties changed due to the change in property resolution. To aid in 
debugging, we keep the old reversed list and when a property is found in the 
default list, we also find it in the reversed default list. If the property 
value found in the reversed list is different than found using the correct 
list, this indicates the new logic could have changed a relevant property value 
and we output a warning. In many cases this can actually be ignored since the 
property values might not actually matter, but when things break this can be a 
useful diagnostic.
   
   Deprecation/Compatibility:
   
   When resolving default properties, Daffodil now gives precedence to 
innermost referenced schema components rather than the outermost, as described 
by section 8.1.4 of the DFDL specification. If this new logic results in a 
different property value than previous versions of Daffodil then a schema 
definition warning is issued.
   
   DAFFODIL-2855


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

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to