RE: Impact of xs:redefine

I'm no supporter of redefine but I think Michael is correct.  If you
import a bunch of schemas, some of which may be redefines, you either
get a valid collection of components or you do not.  The collection of
components you get depends on the schemas you import.  If you import
other (less) schemas you may get different components.

All the best, Ashok

-----Original Message-----
From: public-qt-comments-request@w3.org
[mailto:public-qt-comments-request@w3.org] On Behalf Of Michael Rys
Sent: Sunday, January 04, 2004 12:18 PM
To: Kay, Michael; public-qt-comments@w3.org
Subject: RE: Impact of xs:redefine


Isn't this covered by some of the consistency rules for the types? And
if not, we should specify it as a consistency rule and not as a rule on
how schemata are imported...

Best regards
Michael

> -----Original Message-----
> From: public-qt-comments-request@w3.org [mailto:public-qt-comments-
> request@w3.org] On Behalf Of Kay, Michael
> Sent: Sunday, January 04, 2004 11:11 AM
> To: public-qt-comments@w3.org
> Subject: Impact of xs:redefine
> 
> 
> I think there is probably a need, in both XSLT 2.0 and XQuery 1.0, to
> place
> constraints on the use of xs:redefine in imported schemas.
> 
> The specifications generally assume that schema components are
identified
> uniquely by their expanded QName. However, if one query module imports
> schema1.xsd, and another query module imports schema2.xsd, and
schema1.xsd
> redefines schema2.xsd, then the two query modules are using different
> definitions of the same named types. This means that when a node is
> annotated with a QName, we don't know whether it was validated against
the
> original type or the redefined type.
> 
> There don't appear to be any existing rules that cover this.
> 
> In XSLT 2.0, I think it's reasonably easy to fix, because (a) the set
of
> imported types is the same in all stylesheet modules, and (b) we
define
> the
> semantics of xsl:import-schema in terms of importing a single
composite
> schema, which means that the redefined definitions are used
throughout.
> The
> only problem that arises is when source documents arrive that have
been
> validated against an "unredefined" version of the schema; these may
carry
> type annotations that are inconistent with the redefined types. This
is
> essentially the same problem as occurs when different versions of a
schema
> are used in xsl:import-schema and in source document validation, and
we
> can
> disallow it under the same provision.
> 
> In XQuery 1.0 it's a little more difficult, because each query module
has
> its own static context, but it can still be done under the rule that
all
> versions of a single type definition must be consistent. This amounts
to
> saying (a) it's not allowed for one module to import schema1.xsd and
for
> another module to import a schema that redefines schema1.xsd, and (b)
the
> implementation must (?) detect when this happens. But is this
restriction
> acceptable?
> 
> Michael Kay
> 

Received on Sunday, 4 January 2004 16:12:45 UTC