W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > January to March 2001

Re: include and import

From: Martin Gudgin <marting@develop.com>
Date: Thu, 15 Feb 2001 23:31:20 -0000
Message-ID: <000401c097a7$698ffab0$0200a8c0@greyarea>
To: <afo@zurich.ibm.com>, <www-xml-schema-comments@w3.org>
Cc: "Henry S. Thompson" <ht@cogsci.ed.ac.uk>
I guess it all hinges on whether components imported into schema B from
schema C are 'top-level' components or not. I agree that the text could be
clearer about this particular case.

Perhaps Henry can clear this up for us?

Gudge

----- Original Message -----
From: <afo@zurich.ibm.com>
To: "Martin Gudgin" <marting@develop.com>; <www-xml-schema-comments@w3.org>
Sent: Thursday, February 15, 2001 2:51 PM
Subject: Re: include and import


>
>
>
> Martin Gudgin wrote :
>
> >My understanding is as follows;
>
> >With include the only components that become part of the target namespace
> >are those that are unqualified ( in no namespace ). So in your example
> >Schema A consists of {http://www.example.org/A}{eB}. It may also contain
> >{http://www.example.org/C}{eC} but as Schema B never refers to anything
in
> >the http://www.example.org/C namespace it's hard to tell.
>
>      I don't think a schema needs to explicitly refer to a component in an
> imported schema
> in order to have it  as one of its components.
>      Section  6.2.3 says "The schema components of a schema corresponding
> to a schema element information item with one or more import element
> information items must include not only definitions or declarations
> corresponding to the appropriate members of its [children], but also, for
> each of those import element information items for which clause 1.1 above
> obtains successfully, a set of schema components identical to all the
> schema components of I. "
>
> >It will *never*
> >contain anything called {http://www.example.org/A}{eC}
>
>      That is exactly what I would like but I'm not sure it is what the
spec
> says.
>
> >
> >
> >Because B imports C, the declarations in C are unchanged, they stay in
the
> >http://www.example.org/C namespace. So when B is included by A on eB
> becomes
> >part of the http://www.example.org/A namespace.
>
> >The crucial part of 6.2.1 is
>
> >or (b) no targetNamespace at all, in which case all the top-level
included
> >components are converted to the includeing schema document's
> >targetNamespace.
> >
> >Note that it refers to *top-level* components. The components defined in
> >schema C are not top-level components with respect to schema B.
>
>      This quotation seems to be inconsistent with the following :
>      "The schema components of a schema corresponding to a schema element
> information item with one or more include element information items must
> include not only definitions or declarations corresponding to the
> appropriate members of its [children], but also, for each of those include
> element information items for which clause 1.1 above obtains successfully,
> a set of components identical to all the schema components of I (if clause
> 1.2.2 above obtains), or identical in all respects except their {target
> namespace}, which is that of the includeing schema (if clause 1.2.1 above
> obtains). "
>      There is no reference to "top-level included components" . Maybe the
> editors simply forgot to mention here that only top level included
> component
> are subjected to a namespace modification.
>
>
> >Hope this helps,
>
> Thanks,
>
> Achille Fokoue.
>
>
> ----- Original Message -----
> From: <afo@zurich.ibm.com>
> To: <www-xml-schema-comments@w3.org>
> Sent: Thursday, February 15, 2001 9:59 AM
> Subject: include and import
>
>
> >
> >
> >
> > The spec  (Section 6.2.1 of Part I)  says that if a schema A,  which has
> a
> > non null target namespace, includes a schema B without target namespace,
> > all components of B are included in schema A and their namespace becomes
> > the same as the target namespace of A.
> >       However, although  schema B does not have any target namespace, it
> > may have components with a non null namespace ( for instance if schema B
> > imports another schema whose target namespace is not null). So if my
> > reading of the spec is correct, we should also change the namespace of
> > these
> > components to the target namespace of schema A.
> >
> >       Example:
> >
> >      A.xsd
> >      <schema targetNamesapce="http://www.example.org/A"
> >           xmlns="http://www.w3.org/2000/10/XMLSchema"
> >           xmlns:tns="http://www.example.org/A">
> >
> >           <include schemaLocation="B.xsd"/>
> >
> >      </schema>
> >
> >      B.xsd
> >      <xsd:schema  xmlns:xsd="http://www.w3.org/2000/10/XMLSchema">
> >
> >           <xsd:import namespace="http://www.example.org/C"
> > schemaLocation="C.xsd"/>
> >
> >           <xsd:element name="eB" type="xsd:string"/>
> >
> >      </xsd:schema>
> >
> >      C.xsd
> >      <schema targetNamesapce="http://www.example.org/C"
> >           xmlns="http://www.w3.org/2000/10/XMLSchema"
> >           xmlns:tns="http://www.example.org/C">
> >
> >           <element name="eC" type="xsd:string"/>
> >
> >      </schema>
> >
> >       According to the spec, schema A  consists of
> > {http://www.example.org/A}{eB} and {http://www.example.org/A}{eC} but I
> > wonder if it should not consist of {http://www.example.org/A}{eB} and
> > {http://www.example.org/C}{eC} .
> >
> >      Regards,
> >
> >      Achille Fokoue.
> >
> >
> >
>
>
>
>
Received on Thursday, 15 February 2001 18:32:21 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 6 December 2009 18:12:49 GMT