commit | 1c582cfc73a8333788a6501243eff1f944ba757f | [log] [tgz] |
---|---|---|
author | Steve Lawrence <slawrence@apache.org> | Thu May 25 13:26:52 2023 -0400 |
committer | Steve Lawrence <slawrence@apache.org> | Fri Jun 02 08:45:02 2023 -0400 |
tree | c4250425ab2f170d11917107eb054827ab5687e3 | |
parent | 4c17bfed49942588d0ea10981e3eb131b3cc71e5 [diff] |
Fix separatorSuppressionPolicy="never" Currently, parsing with occursCountKind "implicit" and separator suppression policy "never" behaves similar to occursCountKind "fixed", in that it requires maxOccurs instances, but does not allow for absent representations. This is incorrect--SSP "never" only requires non-absent instance up to minOccurs, and afterwards allows absent occurrences as long as maxOccurs separators are found. To fix this, this modifies parsing to use the same logic as trailingEmpty and trailingEmptyStrict, but adds additional logic at the end of parsing a repetition to ensure that there were no errors or missing separators. This is done by using the same Rep parser, but adding a new PositionalNever flag to differentiate the logic. A new arrayCompleteChecks function is used to check if this flag is set and create a parse error if errors or missing separators occurred. This also renames finalChecks to sequenceCompleteChecks to differentiate it from arrayCompleteChecks. Currently, the unparsing logic is also broken for occursCountKind "implicit" and separator suppression policy "never" if there are no instances of an array/optional element. This is because the logic always looks for a "start" event, which may not exist if minOccurs is zero and all instances have an absent representation. To fix this, this modifies unparseWithNoSuppression to not require "start" events and relies on the existing shouldDoUnparse function to determine if the current event is the right one to unparse. The existing logic will then output any missing separators as needed, with a slight tweak to handle an off-by-one error for infix separators. DAFFODIL-2802, DAFFODIL-2499
Apache Daffodil is an open-source implementation of the DFDL specification that uses DFDL data descriptions to parse fixed format data into an infoset. This infoset is commonly converted into XML or JSON to enable the use of well-established XML or JSON technologies and libraries to consume, inspect, and manipulate fixed format data in existing solutions. Daffodil is also capable of serializing or “unparsing” data back to the original data format. The DFDL infoset can also be converted directly to/from the data structures carried by data processing frameworks so as to bypass any XML/JSON overheads.
For more information about Daffodil, see https://daffodil.apache.org/.
See BUILD.md for more details and DEVELOP.md for a developer guide.
sbt is the officially supported tool to build Daffodil. Below are some of the more commonly used commands for Daffodil development.
Compile source code:
sbt compile
Run unit tests:
sbt test
Run slower integration tests:
sbt daffodil-test-integration/test
Build the command line interface (Linux and Windows shell scripts in daffodil-cli/target/universal/stage/bin/
; see the Command Line Interface documentation for details on their usage):
sbt daffodil-cli/stage
Run Apache RAT (license audit report in target/rat.txt
and error if any unapproved licenses are found):
sbt ratCheck
Run sbt-scoverage (report in target/scala-ver/scoverage-report/
):
sbt clean coverage test daffodil-test-integration/test sbt coverageAggregate
You can ask questions on the dev@daffodil.apache.org or users@daffodil.apache.org mailing lists. You can report bugs via the Daffodil JIRA.
Apache Daffodil is licensed under the Apache License, v2.0.