RE: redefine and interoperability problems

> > I personally think xs:redefine is one of those facilities 
> (xsi:nil is
> > another) where you're better off pretending it doesn't exist. 
> > Implementors don't have that luxury, but users do.
> 
> Hmm. The DITA schemas depend entirely on xs:redefine in order 
> to provide the equivalent configurability to the parameter 
> entities in the DTD versions, that is, using schemas can 
> redefine the members of groups that are then referenced from 
> the used schemas.

I have successfully tackled that problem by writing code that transforms
schemas (or near-schemas) to provide the configurability. I think it's
better to have this kind of capability in a separate language (indeed, a
separate architectural component of the system) rather than building in
self-modification semantics to the language itself.

I would have thought that the configurability you describe above could be
achieved by the even simpler technique of URI-switching - that is,
redirecting the URI in an xs:include to refer to a selected variant of the
included module.

xs:redefine is particularly horrible once schemas start to have wider scope
than a single validation episode, specifically, when multiple variants of a
schema component have to coexist. In particular, if you've got an XML
database whose contents are described by a family of schemas, the notion
that xs:redefine is "pervasive" could be taken to mean that it effectively
alters schemas that are used in a quite unrelated part of the database,
including schemas describing documents that were stored years ago. That's
clearly untenable; but finding a different definition of "pervasive" that
actually works in this environment isn't easy. Saxon's approach is to say
that once a schema component has been "used" (in some carefully defined
sense) further redefinition is banned. 

(Having said that, this problem affects any technique that leaves you with
multiple versions or variants of a schema component coexisting. I think
Roger Needham once said that all problems in computer science can be solved
by adding another level of indirection; and certainly the problem of
handling multiple coexisting versions of schema components appears insoluble
without adding a version/variant qualifier to the name of the component.)

Michael Kay
http://www.saxonica.com/

Received on Thursday, 5 April 2007 08:41:23 UTC