...
You can see this in PR: https://github.com/apache/daffodil/pull/643
There is an IPv4 layer example/test, and a checkDigits example/test.
This illustrates a way of doing "field extensibility" of layer transforms now, without any particular dynamic loading feature.
...
- The enum check in dfdlx.xsd should just be removed entirely, and the diagnostic message if the layer transform is not found should list all the currently registered layer transform names.
- Provide a way that the evaluation of dfdlx:layerTransform property, if the name does not correspond to a registered LayerTransformFactory, it could guess the name of the corresponding LayerTransformFactory object, (e.g, by uppercase first letter, and append "LayerTransformFactory" to the string value of the property) and try to dynamically load it.
Test Plan
- that class.
Additional Changes
The following existing (as of Daffodil 3.1.0) layering transforms should be removed from daffodil-runtime1 and put in a daffodil-layers module.
- aisPayloadArmoring
- fourByteSwap
These enums for LayerTransformEnum should be removed as they are not implemented:
- quotedPrintable
- compress
- base64
- base64url
Test Plan
Testing during Daffodil 'sbt test' Build Cycle
Tests in daffodil-test will illustrate how dynamic loading of a layer from a jar works, but the jar in that case isn't a published jar.
This uses stripped down versions of the IPv4 header checksum, and OTH-Gold-style check-digits.
- Improvement: Be sure to call these FakeIPv4 or similar renaming to avoid confusion with the real ethernet-ip schemas.
Testing of User-like Situations - Outside the Daffodil Repository Tree
DFDL Schemas Regression Testing Rig
There is a general schema regression testing rig that enables developers to easily maintain a large tree of DFDL schemas for regression testing against daffodil.
This tool/repo should be published. This uses git submodules so that it does not copy schemas.
This should then test the "real" schemas mentioned below.
Updating "Real" DFDL Schema Examples that use Layers
The ethernet-ip DFDL schema (on github) can be made into a full exercise of dynamically loading an implementation of IPv4 checksumsof IPv4 checksums.
- It could further be extended to do ICMP, TCP, UDP checksums also.
- The PCAP schema which uses this ethernet-ip schema would inherit this also.
The OpenDFDL (on github - note: should move to DFDLSchemas) example checkDigits schema can be made into a complete example.
The DFDLSchemas (on github) GPS-SPS example computes parity bits. This could also be made into a complete test example - though this is quite large.