mike-mcgann commented on code in PR #898:
URL: https://github.com/apache/daffodil/pull/898#discussion_r1054421420


##########
daffodil-propgen/src/main/resources/org/apache/daffodil/xsd/dfdlx.xsd:
##########
@@ -99,6 +99,7 @@
     <xs:restriction base="xs:string">
       <xs:enumeration value="treatAsEmpty" />
       <xs:enumeration value="treatAsMissing" />
+      <xs:enumeration value="treatAsAbsent" />

Review Comment:
   This is a bit of a hack and I couldn't find a way to easily make this 
cleaner. Let me know if you can think of a better way. 
   
   The issue is that we want to support the new and old attribute, for now, at 
the same time. An element could have a dfdl:emptyElementParsePolicy or a 
dfdlx:emptyElementParsePolicy but the property generator fabricates variables 
using the unprefixed name. Therefore we cannot easily have both of these 
properties with different types since they map to the same symbol. The schema 
validator correctly uses the empty/absent enumeration when evaluating the 
attribute with the dfdl prefix but then the parser uses the dfdlx enumeration 
definition (which is manually constructed and ignored by the property 
generator). The absent value was added to the dfdlx enumeration to support both 
new and old since there can be only one type. I guess the cleanest way would be 
to change the property generator to use fully qualified attribute names, or at 
least use them when necessary, but I'm not sure what the wider consequences of 
that change would be. 



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