This is an automated email from the ASF dual-hosted git repository.
slawrence pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/daffodil.git
The following commit(s) were added to refs/heads/main by this push:
new 6edf5304a Fix mapping from separatorPolicy to
separatorSuppressionPolicy
6edf5304a is described below
commit 6edf5304a355991dba169b163f2f191a981a1f01
Author: Steve Lawrence <[email protected]>
AuthorDate: Wed Mar 13 08:13:09 2024 -0400
Fix mapping from separatorPolicy to separatorSuppressionPolicy
Daffodil allows use of the deprecated separatorPolicy property and
internally maps it to the new separatorSuppressionPolicy property.
Unfortunately, according to the OGF Errata document our mapping is
wrong, which means suppressedAtEndLax behaves like trailingEmptyStrict
and suppressedAtEndStrict behaves like trailingEmpty. This is reversed
from how it should be. This fixes that mapping so they have the correct
behavior.
Deprecation/Compatibility:
The deprecated separatorPolicy property values of "suppressedAtEndLax"
and "suppressedAtEndStrict" had incorrect behaviors, with each property
behaving like the other. Schemas using one value should be updated to
use the other. Alternatively, schemas should be updated to use the new
separatorSuppressionPolicy property with the following mappings from the
deprecated property:
* required -> never
* suppressed -> anyEmpty
* suppressedAtEndLax -> trailingEmpty
* suppressedAtEndStrict -> trailingEmptyStrict
DAFFODIL-2882
---
.../apache/daffodil/lib/schema/annotation/props/ByHandMixins.scala | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git
a/daffodil-lib/src/main/scala/org/apache/daffodil/lib/schema/annotation/props/ByHandMixins.scala
b/daffodil-lib/src/main/scala/org/apache/daffodil/lib/schema/annotation/props/ByHandMixins.scala
index f4ad30fe5..4e32d8067 100644
---
a/daffodil-lib/src/main/scala/org/apache/daffodil/lib/schema/annotation/props/ByHandMixins.scala
+++
b/daffodil-lib/src/main/scala/org/apache/daffodil/lib/schema/annotation/props/ByHandMixins.scala
@@ -197,8 +197,8 @@ trait SeparatorSuppressionPolicyMixin extends PropertyMixin
{
spString match {
case "required" => SeparatorSuppressionPolicy.Never
case "suppressed" => SeparatorSuppressionPolicy.AnyEmpty
- case "suppressedAtEndStrict" =>
SeparatorSuppressionPolicy.TrailingEmpty
- case "suppressedAtEndLax" =>
SeparatorSuppressionPolicy.TrailingEmptyStrict
+ case "suppressedAtEndLax" => SeparatorSuppressionPolicy.TrailingEmpty
+ case "suppressedAtEndStrict" =>
SeparatorSuppressionPolicy.TrailingEmptyStrict
case _ => Assert.invariantFailed("illegal string for
separatorPolicy")
}
}