stevedlawrence commented on pull request #481:
URL: https://github.com/apache/daffodil/pull/481#issuecomment-794025854
I think I have an idea of what's going on here. The separator in this case
is is ``%WSP;%WSP*;\%NL;%WSP;%WSP*;``. The previous test in
``DelimiterCookerNoES`` looked like this:
```scala
context.schemaDefinitionUnless(raw != "%WSP*;", "Property dfdl:%s cannot
contain %%WSP*;...")
context.schemaDefinitionUnless(raw != "%ES;", "Property dfdl:%s cannot
contain %%ES;...")
```
So although the error messages is "Property cannot contain %WSP* or %ES", it
was really only checking if the entire property value is ``%WSP*;`` or
``%ES;``. In this test case, the entire property value is neither of those
(it's a bunch of combined character classes) and so it was allowed.
But with your new changes you have made it so ``ES`` and ``WSP*`` are
disallowed if they show up **anywhere**, which is the case in this example. So
you've changed the behavior to be much more strict than it previously was.
The DFDL spec says about the dfdl separator property:
* DFDL Character Class ES is not allowed.
* The WSP* entity cannot appear on its own as one of the string literals in
the list when determining the length of a component by scanning for delimiters.
So we are doing the correct thing for ES by disallowing it, but WSP*
shouldn't be blanket disallowed. It should only be disallowed if it's the sole
separator.
So for DelimiterCookerNoES, ``disallowedCharClassEntities`` should contain
only ``ES``. And we need an additional check for a sole WSP*. So what we
probably for this cooker is something like this:
```scala
override val disallowedCharClassEntities = Seq("ES")
override def testRaw(raw: String, context: ThrowsSDE) = {
context.schemaDefinitionUnless(raw != "%WSP*;", "The WSP* entitty canont
appear on it's own ...")
super[DisallowedCharClassEntitiesMixin].testRaw(raw, context)
}
```
This way we manually test for the sole WSP* and use the disallowed logic to
check for ES.
----------------------------------------------------------------
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]