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

Re: Can an attribute have an alias name?

From: Mukul Gandhi <gandhi.mukul@gmail.com>
Date: Fri, 1 Jul 2011 14:04:22 +0530
Message-ID: <BANLkTikoXMGCiBoJr5O8a3rZsdWsEgzLDQ@mail.gmail.com>
To: XMLSchema at XML4Pharma <XMLSchema@xml4pharma.com>
Cc: mlcook@wabtec.com, xmlschema-dev@w3.org
The suggestion of using assertions in this case, was not to say that
this method is best by design. Assertions seem to solve the "alias"
creation problem been mentioned.

The best design may be (as suggested by Jozef & Mike) to keep your
schema same (it doesn't look good design to define two attributes in
schema, for one problem domain concept), and write a transformation
(XSLT is good for this need) pre-process step to convert one attribute
to another (as required by your original schema).

On Fri, Jul 1, 2011 at 11:33 AM, XMLSchema at XML4Pharma
<XMLSchema@xml4pharma.com> wrote:
> Not allowing both attributes (name and new-name) at the same time cannot be
> done in XML-Schema 1.0. It can be done in Schematron or in XML-Schema 1.1
> (using the schematron construct).
> Do you really have a change in a well-established spec/schema? That should
> lead to a new version of the spec/schema. This would mean that the new
> schema has a different namespace than the old one, so that it is always
> immediately clear whether an instance XML file is according the old version
> of the spec or according the new version.
> 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.
> Best,
> Jozef Aerts
> XML4Pharma

Mukul Gandhi
Received on Friday, 1 July 2011 08:35:09 UTC

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