[netcf-devel] Schema versioning and evolution

David Lutterkort lutter at redhat.com
Mon Jun 29 21:02:54 UTC 2009


One of the things that I'd like to settle on before declaring the
interface schema (in data/xml/interface.rng) final, is how to handle
schema versioning and schema evolution.

The schema will only be allowed to evolve in a way that is backwards
compatible: if an interface.xml is valid against version N of
interface.rng, it has to remain valid against all future versions. That
implies that changes to the schema can only add to it, never take away.

Sometimes it's desirable though to see whether an interface.xml is valid
against some older version of the schema; to facilitate that, I am
thinking of annotating interface.rng with version information:
      * versions are simple integers, that only increase
      * put version annotiation into a 'version' namespace (say
        http://netcf.org/xml/version/1.0)
      * add a 'version:serial' attribute to the start tag in
        interface.rng. This indicates the current version of
        interface.rng
      * add a 'version:since' attribute on constructs that are
        introduced in later revisions of the schema

With that, if we have version 7 of interface.rng, we can reproduce the
schema for version 5 by removing any tags (and their contents) from the
RelaxNG that have a version:since > 5.

This should work well for adding elements, attributes, expanding the
list of allowed values for existing attributes etc. and introduces very
little overhead.

Any thoughts on this ?
David




More information about the netcf-devel mailing list