Add support for infoset dataType member

- Add new setIncludeDataType and getIncludeDataType functions to the
  InfosetOutputter API to configure if InfosetOutputters should include
  the dataType member when creating infosets. It is left up to specific
  InfosetOutputter implementations if an how to represent this member in
  their infosets
- The XMLTextInfosetOutputter and ScalaXMLInfosetOutputter are updated
  to include the xsi:type attribute when this is enabled. They also
  define the "xsi" namespace prefix if not already defined. Other
  InfosetOutputters do not currently implement this.
- Update the TDML Runner to enable this flag for all infoset outputters.
  The TDML Runner already supports type-aware comparisons when xsi:type
  is provided, so enabling this allows all TDML test to use type aware
  logic. This means expected infosets no longer need to include xsi:type
  when for type-aware comparisons.
- Add new "infosetIncludeDataType", which calls setIncludeDataType if
  set. This allows enabling this feature without needing to modify code
  to call the new API function
- Fix TDML tests that used an xsi:type value that did not match
  the actual value
- Discovered a bug where xs:decimal elements could be output with
  scientific notation. This is not legal in XSD so these elements are
  now output using .toPlainString

Deprecation/Compatibility

- Previous versions of Daffodil could sometimes use scientific notation
  when outputting elements with an xs:decimal type, which XSD does not
  allow. Daffodil now always outputs xs:deicmal types using standard
  decimal notation without any exponent part.

DAFFODIL-182
10 files changed
tree: 96b1385bcdc0f20734f78178b97bb44fcbf68a60
  1. .github/
  2. daffodil-cli/
  3. daffodil-codegen-c/
  4. daffodil-core/
  5. daffodil-macro-lib/
  6. daffodil-propgen/
  7. daffodil-schematron/
  8. daffodil-slf4j-logger/
  9. daffodil-tdml-junit/
  10. daffodil-tdml-lib/
  11. daffodil-tdml-processor/
  12. daffodil-test/
  13. daffodil-test-ibm1/
  14. daffodil-test-integration/
  15. project/
  16. scripts/
  17. test-stdLayout/
  18. tutorials/
  19. .asf.yaml
  20. .codecov.yml
  21. .gitattributes
  22. .gitignore
  23. .sbtopts
  24. .scalafmt.conf
  25. .sonar-project.properties
  26. BUILD.md
  27. build.sbt
  28. DEVELOP.md
  29. KEYS
  30. LICENSE
  31. NOTICE
  32. README.md
  33. VERSION
README.md

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/.

Build Requirements

  • Java 8 or higher
  • sbt 0.13.8 or higher
  • C compiler C99 or higher
  • Mini-XML Version 3.0 or higher

See BUILD.md for more details and DEVELOP.md for a developer guide.

Getting Started

sbt is the officially supported tool to build Daffodil. Below are some of the more commonly used commands for Daffodil development.

Compile

Compile source code:

sbt compile

Test

Check all unit tests pass:

sbt test

Check all integration tests pass:

sbt daffodil-test-integration/test

Format

Check format of source and sbt files:

sbt scalafmtCheckAll scalafmtSbtCheck

Reformat source and sbt files if necessary:

sbt scalafmtAll scalafmtSbt

Build

Build the Daffodil 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

Publish the Daffodil jars to a Maven repository (for Java projects) or Ivy repository (for Scala or schema projects).

Maven (for Java or mvn):

sbt publishM2

Ivy (for Scala or sbt):

sbt publishLocal

Check Licenses

Run Apache RAT (license audit report in target/rat.txt and error if any unapproved licenses are found):

sbt ratCheck

Check Coverage

Run sbt-scoverage (report in target/scala-ver/scoverage-report/):

sbt clean coverage test daffodil-test-integration/test
sbt coverageAggregate

Getting Help

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.

License

Apache Daffodil is licensed under the Apache License, v2.0.