W3C home > Mailing lists > Public > xmlschema-dev@w3.org > March 2004

RE: pervasiveness of a redefine

From: James Taylor <JTaylor@nextance.com>
Date: Mon, 29 Mar 2004 15:23:09 -0800
Message-ID: <9F5ED6009B16CE47B2C02694103CFBE30B572C@mail-1.nextance.com>
To: "Henry S. Thompson" <ht@inf.ed.ac.uk>
Cc: <xmlschema-dev@w3.org>

Thanks for the clarifications.  One follow-up question: if redefines are
chained, that is, File D again redefines the Employee type from file
Company.xsd, should this again redefine all occurrences of the Employee
type?  In other words, there's always one and only one type definition
for a given type with the last/outermost redefine "winning".


-----Original Message-----
From: Henry S. Thompson [mailto:ht@inf.ed.ac.uk] 
Sent: Monday, March 29, 2004 12:49 AM
To: James Taylor
Cc: xmlschema-dev@w3.org
Subject: Re: pervasiveness of a redefine

"James Taylor" <JTaylor@nextance.com> writes:

> How pervasive should a redefine be?  For example:
> File A defines Employee type
> File B includes File A and defines Department type

In principle this is _no_ different from File B defining both
Department and Employee -- include is meant to be a _zero_ impact way
of dividing up a schema document.

> File C includes File B, redefines Employee from File A and defines
> Company type
> Are the schemas I've included below the correct way of expressing
> this?  XSV handles this case in the way I'd expect, redefining the
> Employee type in all occurrences.

Yes, and that's correct as I read the spec.  However it's less than
obvious what's going on -- I'd recommend instead of

>   <xs:include schemaLocation="Department.xsd"/>
>   <xs:redefine schemaLocation="Employee.xsd">

you simply did

  <xs:redefine schemaLocation="Department.xsd">
   . . .

> Also, what is the "scope" of a redefine


> and how should conflicts be resolved?

There shouldn't be any.

> For example, are there cases in which the original Employee type
> would be used?


> And what about redefining a type in multiple/different ways?

Don't do that :-).

Two alternative redefines "at the same level" as it were, that is, in
the _same_ schema document, would give two distinct definitions for the
same type name, so an error.

> For example, if there was a File D that redefined the Employee type
> from File A in a different way to create a new derived type.  Could
> File D be included and the new derived type used in File C?

No, that's a case of what I described above.  But chained
redefinitions are just fine, that is, File D redefines the Employee
type from file Company.xsd.

 Henry S. Thompson, HCRC Language Technology Group, University of
                     Half-time member of W3C Team
    2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
            Fax: (44) 131 650-4587, e-mail: ht@inf.ed.ac.uk
                   URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged
Received on Monday, 29 March 2004 19:53:47 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:04 UTC