mbeckerle commented on a change in pull request #153: Add a distinction between 
how expressions and literals are compiled
URL: https://github.com/apache/incubator-daffodil/pull/153#discussion_r241102718
 
 

 ##########
 File path: 
daffodil-test/src/test/resources/org/apache/daffodil/section07/variables/variables.tdml
 ##########
 @@ -1061,4 +1061,67 @@
     </tdml:errors>
   </tdml:parserTestCase>
 
+
+  <tdml:defineSchema name="logical_default_values">
+    
+    <xs:include 
schemaLocation="org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd"/>
+    <dfdl:format ref="ex:GeneralFormat" />
+
+    <dfdl:defineVariable name="float" type="xs:float" defaultValue="-INF" />
+    <dfdl:defineVariable name="double" type="xs:double" defaultValue="1.0e-5" 
/>
+    <dfdl:defineVariable name="bool" type="xs:boolean" defaultValue="false" />
 
 Review comment:
   Are 'false' and 'true' actually values?  Does the DFDL spec really allow 
defaultValue="false" for booleans?
   I'm not against this. I'm just not sure where the DFDL spec blesses a syntax 
for boolean values.
   
   Maybe this is missing from the DFDL spec? 
   
   I know there is no syntax for specifying nil, for example. There's no way to 
have an expression on say, dfdl:inputValueCalc cause a nillable element to be 
nilled. So there are definitely limitations on the expression language's 
capabilities. 
   
   In actual expressions, you have to use fn:true() and fn:false(). The literal 
value syntax of "true" and "false" isn't allowed. 
   
   I know for a boolean element the XSD attribute default="false" would be 
allowed, but that's not the same language of literals as DFDL string literals. 
E.g., in XSD attribute default="....", you can't use DFDL entities.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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