You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by GitBox <gi...@apache.org> on 2020/05/27 04:07:13 UTC

[GitHub] [incubator-daffodil] mbeckerle commented on a change in pull request #385: Fix initiatedContent="yes" with empty initiator

mbeckerle commented on a change in pull request #385:
URL: https://github.com/apache/incubator-daffodil/pull/385#discussion_r430426236



##########
File path: daffodil-runtime1/src/main/scala/org/apache/daffodil/dsom/CompiledExpression1.scala
##########
@@ -143,7 +143,7 @@ final case class ConstantExpression[+T <: AnyRef](
 
   lazy val sourceType: NodeInfo.Kind = NodeInfo.fromObject(value)
 
-  def isKnownNonEmpty = value != ""
+  def isKnownNonEmpty = value != "" && value != "%ES;" && !(value == "%WSP*;" && qn.toQNameString == "dfdl:initiator")

Review comment:
       An idea: just push the responsibility to answer the question "can match empty string" down to a method of the DFADelimiter, and all DFADelimiters except ESDelim and WSPStarDelim answer false, those two answer true. 
   
   I'm not sure it's that simple though. There can be escape-schemes involved I think. 




----------------------------------------------------------------
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:
users@infra.apache.org