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

Re: pervasiveness of a redefine

From: Henry S. Thompson <ht@inf.ed.ac.uk>
Date: Mon, 29 Mar 2004 09:49:13 +0100
To: "James Taylor" <JTaylor@nextance.com>
Cc: <xmlschema-dev@w3.org>
Message-ID: <f5br7vcvy0m.fsf@erasmus.inf.ed.ac.uk>

"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

Unbounded.

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

No.

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

ht
-- 
 Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
                     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 spam]
Received on Monday, 29 March 2004 03:51:24 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 23:40:23 UTC