To be clear: flattening a schema is combining it and all its components into a single directory, renaming files for uniqueness and adjusting all the import/include schemaLocations to refer to the new names. This also grabs the DFDLGeneralFormat.dfdl.xsd from daffodil-lib and the other files it includes, and incorporates those as well into the single directory.
I think we should add schema flattening. It should be optional, but available. We either have to provide this, or thoroughly document how to do it by hand, and I'd rather spend the time on the automated version and documenting how to use a feature than how to do it the hard way. Rationale is this: Despite the fact that I try to say "DFDL is not all about XML", most users are using daffodil to convert data to/from XML, at least in Cyberia. These systems use a variety of XML Schema-aware tools to process data. Experiments by Owl have determined that the only common behavior that all XML-Schema aware tools (that we tested) implement is for the schemaLocation attribute to always be just a file name, and for that file to appear in the same directory/folder as the file including/importing it. No form of relative nor absolute paths in the schemaLocation attribute are fully portable. Note: these Owl experiments did not explore whether XML Catalogs could be used to make the include/import statements portable. A quick web search does show that some of the major XML Schema validators (libxml2 and xerces-c) do have XML Catalog support, as do Daffodil and Xerces-J.) It is also unknown to me if the XML Catalog support is sufficiently portable across various tools. However, I do know there are fielded Cyberian systems (from Owl, and likely others) that do not allow for an XML Catalog to be provided, so for them the only solution is to flatten the entire schema into a single directory. Doing this flattening by hand is possible, but very tedious. So it makes sense for daffodil's sbt plugin to provide this tool, so people can more easily use a DFDL schema as an XML Schema with any variety of XML processing infrastructure. I also prefer to see a flattening tool as part of deployment based on managed-dependencies being used to pull schemas together from component schemas. On Thu, Oct 31, 2024 at 9:28 AM Adams, Joshua <jad...@owlcyberdefense.com> wrote: > One thing we might want to add (but probably needs some internal > discussion) is schema flattening functionality. > > Josh > ________________________________ > From: Steve Lawrence <slawre...@apache.org> > Sent: Thursday, October 31, 2024 7:18 AM > To: dev@daffodil.apache.org <dev@daffodil.apache.org> > Subject: [DISCUSS] Release Apache Daffodil SBT Plugin v1.2.0 > > The SBT Plugin has a number of really useful additions, including > defaulting to > Daffodil 3.9.0. I think it's about time we should to do a release. > > There's one open PR that should probably be included and needs another +1: > > #69: Add support for publishArtifact setting > > https://github.com/apache/daffodil-sbt/pull/69 > > Does anyone have any other bug fixes or features they would like included > in the > next release? If not, I'll volunteer to be the release manager and plan to > start > the release process on Tuesday. > > - Steve >