Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

That is, peer files need not carry the long "com/tresys/RFormat/xsd/" prefix that makes the reference globally unique.

However, if one schema wants to include another different schema, then this standard way of organizing schema projects insures that when packaged into Jar files, the /src/main/resources directory contents are at the "root" of the jar file so that the schemaLocation of the xs:import or xs:include containing the fully qualified path ("com/tresys/RFormat/xsd/main.dfdl.xsd") will be found on the CLASSPATH unambiguously. This convention is what allows the schema files themselves to have short names like main.dfdl.xsd, and format.dfdl.xsd. Those names only need to be unique within a single schema project. Across schema projects our standard DFDL schema project layout insures unambiguous qualification is available.

Git Revision Control

You don't have to use Git version control, but many people do, and github.com is one of the reasons for this popularity.

Each DFDL schema should have its own Git repository if it is going to be revised independently. We encourage users to join the DFDLSchemas project on github and create repositories for, and publish schemas for any publicly-available formats there. For other formats that are not publicly available, one may want to put a placeholder for them on DFDLSchemas anyway (as IBM has done for some formats like Swift-MT.)

Jar File Packaging

A DFDL schema using the recommended file structure as described here, can be packaged into a jar for convenient import/include from other schemas.

The sbt command does all the work:

Code Block
sbt package       # creates jar
sbt publish-local # puts it into local .ivy2 cache where other maven/sbt will find it.

The resulting jar has the src/main/resources directory in it at the root of the jar. If this jar is on the classpath, then other schemas containing XSD import or include statements will search the jar with the schema location.

That enables a different schema's build.sbt to contain a library dependency on our hypthetical dfdl-RFormat schema using a dependency like this:

Code Block
"com.tresys" % "dfdl-RFormat" % "0.0.1" % "test"

That will result in the contents of the src/main/resources directory above being on the classpath. XSD include and import statements search the classpath directories.