apache / apache/daffodil-sbt

Schema File Merging Feature

Open
#185 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Scala
Stars
2
Forks
7
PR merge metrics
No merged PRs in 30d

Description

This is an additional feature request. In addition to flattening all the files (#131) , an option should merge all files that are compatible so as to produce a schema with as few files as possible.

Turns out multiple different vendors of XML systems have products which assumed XML schemas consist of one (typically) or only a few files. A flattened schema helps, but sometimes users must enter every file name of the entire flattened schema into a GUI dialog one by one. A schema containing 100+ files remains very tedious to set up.

The simplest packaging of an XSD without loss of generality is one file per combination of

- target namespace (or no namespace)

and XSD attributes of the xs:schema which apply lexically to the schema document:

- elementFormDefault
- attributeFormDefault
- blockDefault
- finalDefault
- version
- id
- xml:lang
- defaultAttributes (XSD 1.1 only)
- xpathDefaultNamespace (XSD 1.1 only)

all of which are rarely used (and some are not even allowed in DFDL schemas).

Schema files also must have compatible (non-conflicting) namespace prefix definitions including any default namespace.

And for DFDL schemas, they must have identical top level dfdl:format definitions.

The point is to reduce the number of schema files to the smallest number possible.

I would also suggest that when tools generate large XSD/DFDL schemas, they should avoid creating large numbers of files due to this unfortunate, but pervasive, limitation found in many XML Schema based tools and systems.

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue names no files, tests, or entry points. Start by locating the flattening implementation referenced in #131, then map its schema parsing and output flow against the namespace, schema-attribute, prefix, and DFDL-format compatibility requirements; done means producing the fewest compatible schema files without conflicts.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
build-system, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.