Yep, even the primary schema can come from a jar on the classpath. You put all the jars on the classpath using DAFFODIL_CLASSPATH like normal, and then set the --schema option to the path *inside* the jar.

So for example, if you had a jar called dfdl-foo.jar, and inside it was the main schema resource at com/example/foo.dfdl.xsd, you could do:

  $ export DAFFODIL_CLASSPATH="/path/to/dfdl-foo.jar"
  $ daffodil parse -s com/example/foo.dfdl.xsd ...

Note that the CLI doesn't actually do anything special for that path. The CLI just passes it unmodified to Daffodil and Daffodil internals use the usual include/import logic for resolving that path to a schema, whether it be a path on disk or a resource inside a jar.

On 12/28/21 6:31 PM, Mike Beckerle wrote:
Does the CLI have a way to use DFDL schemas where all of them are
specified in jar files on the classpath?

I know all but the primary one can be on the classpath, but what if
all of them are packaged in jars, none are textual in files.

  • CLI question Mike Beckerle
    • Re: CLI question Steve Lawrence

Reply via email to