[netcf-devel] Schema versioning and evolution

Daniel Veillard veillard at redhat.com
Wed Jul 1 13:39:23 UTC 2009


On Mon, Jun 29, 2009 at 09:02:54PM +0000, David Lutterkort wrote:
> 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

  yes version="12" on the top element is fine

>       * put version annotiation into a 'version' namespace (say
>         http://netcf.org/xml/version/1.0)

  Hum ... 

>       * 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

  Well, well, is that better than a comment ? Are you really expecting
automated processing of thos namespaced attributes on the rng ? if no
just keep them as comments it will be clearer for people that it's
intended for their consumption rather than some feature of RNG they
might ignore.

> 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.

  I would just keep pristine exemples of the older interfaces in the
source distribution. When bumping version to N + 1 save old
interface.rng to interface-N.rng , that way people will be able to
immediately validate against old schemas for compat and it's not like
this will exhaust filesystem space, really :-)

> 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 ?

  Too complex IMHO :-)

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel at veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/


More information about the netcf-devel mailing list