W3C home > Mailing lists > Public > xmlschema-dev@w3.org > November 2002

Question about xs:import

From: Kriegesmann, Peter <Peter.Kriegesmann@softwareag.com>
Date: Fri, 15 Nov 2002 13:02:08 +0100
Message-ID: <DFF2AC9E3583D511A21F0008C7E62106023724E2@daemsg02.software-ag.de>
To: xmlschema-dev@w3.org

Hello friends of the XML schema,
Today I have a question about the correctness of using xs:import statement
without namespace attribute.
As I understood the spec the following schema A has no errors:

1. Schema A.xsd

<xs:schema xmlns:cst="<http://myTargetNamespace>"
<xs:import schemaLocation="<http://www.schematesting.org/B.XSD>"/>

<xs:element type="globalTestComplexType" name="testGLobalComplexType"/>

2. Schema B.xsd

<xs:schema xmlns:xs = "<http://www.w3.org/2001/XMLSchema>">
<xs:complexType name="globalTestComplexType">
<xs:extension base="xs:boolean"> 
	<xs:attribute name="testAttribute2" use="required"/>

According to the W3C speficification
<http://www.w3.org/TR/xmlschema-1/>) the schema "A.xsd" should be fine.

Here is my explanation:

1. Schema A.xsd must have a "targetNamespace" attribute (according to spec)
2. When the parser encounters the element definition of
"testGLobalComplexType" in A.xsd, he analyses if there is such a global type
definition. Since there is a targetNamespace-definition but no xmlns="..."
declaration and also no global type definition he follows the hints of the
xs:import element
3. Within B.xsd the parser finds a global type definition named
4. Now the parser only has to check if B.xsd has no targetNamespace defined,
because then the types again wouldn't match
5. Since this is not the case, schema "A.xsd" follows the W3C standards and
has no errors.
Best regards,

"Die Welt ist so groß, dass alle Irrtümer darin Platz haben."
Rudolf Augstein (1923 - 2002)
Peter Kriegesmann
Phone	 06151-921484
Electronic Business Technologies (QE)				Fax
Software AG
Uhlandstrasse 12				  
D-64297 Darmstadt
Received on Friday, 15 November 2002 07:02:16 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:07 UTC