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

include and import

From: <afo@zurich.ibm.com>
Date: Thu, 15 Feb 2001 10:59:17 +0100
To: www-xml-schema-comments@w3.org
Message-ID: <C12569F4.0036D2CD.00@d12mta01.de.ibm.com>



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 05:00:12 GMT

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