W3C home > Mailing lists > Public > xmlschema-dev@w3.org > July 2011

Re: Can an attribute have an alias name?

From: Michael Kay <mike@saxonica.com>
Date: Fri, 01 Jul 2011 09:17:36 +0100
Message-ID: <4E0D82A0.3040700@saxonica.com>
To: xmlschema-dev@w3.org

> The best solution i.m.o. is to write a little XSLT that transforms old 
> files into new ones, copying everything except for the attributes that 
> changed name, and replacing the latter ones. If the new version has a 
> different namespace, updating it can also be done at the same 
> time.This is much easier than doing a mass scripted edit of all files.

Agreed. Whenever you have to deal with two variants of the same 
vocabulary, for whatever reason, my recommendation is to never to write 
any program (even a schema) that tries to deal with both variants. 
Instead write a converter (or two converters, one in each direction) and 
insert these into your processing pipeline when needed.

There are many benefits in this approach: the conversion code is highly 
reusable, and it can be dropped easily when it is no longer needed, 
avoiding the problem of maintaining programs that are full of 
conditional logic for handling situations that no longer arise.

Michael Kay
Saxonica
Received on Friday, 1 July 2011 08:18:00 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:59 UTC