W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > October to December 2000

Import with same targetNamespace as importing schema

From: Roberto Galnares <galnares@us.ibm.com>
Date: Mon, 11 Dec 2000 18:03:36 -0500
To: www-xml-schema-comments@w3.org
Message-ID: <OF90FD434D.E2D5B627-ON852569B2.007E3A72@pok.ibm.com>
We would like to know if it is allowed to use the same targetNamespace in
an imported schema as the one declared in the importing schema. We know we
can use 'include' to handle those cases, but we want to know if doing it
with 'import' should produce an error or not.

We could not find something definitive in the 'Import Constraints and
Semantics' forbidding the use of the same targetNamespace. If the
constraint exists  somewhere else in the specifications please let us know
where.


Example schema:

<xsd:schema xmlns:xsd="http://www.w3.org/2000/10/XMLSchema" targetNamespace
="http://www.abc.com/Import1">

  <xsd:import namespace="http://www.abc.com/Import1" schemaLocation="
ImportSameTNS.xsd"/>

  <xsd:complexType name="ComplexType01">
    <xsd:simpleContent>
      <xsd:extension base="SimpleType01"/>
    </xsd:simpleContent>
  </xsd:complexType>

</xsd:schema>

Imported schema (ImportSameTNS.xsd):

<xsd:schema xmlns:xsd="http://www.w3.org/2000/10/XMLSchema" targetNamespace
="http://www.abc.com/Import1">

  <xsd:simpleType name="SimpleType01">
    <xsd:restriction base="xsd:string"/>
  </xsd:simpleType>

</xsd:schema>


Thanks,


Roberto Galnares
Received on Monday, 11 December 2000 18:03:46 GMT

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