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

Import Vs. Include

From: Chang Li <write_chang@hotmail.com>
Date: Mon, 25 Mar 2002 23:54:27 -0500 (EST)
To: <xmlschema-dev@w3.org>
Message-ID: <OE35su1enHv1cO9MH7C0000128a@hotmail.com>
While I was reading the specification of XML Schema, I am a little confused by "include" and "import".  It sounds like "include" can only include schemas that share the same target namespace with the including schema, while import can import schemas that have different namespaces.  When we use include, we include both the declaration of elements and the definition of types.  Both elements and types can be used in the including schema.  It looks as if we have cut and pasted the included schemas in the including schema and make a single large schema definition file out of all the involved schemas.  In the case of a "import", however most of the examples I have seen so far indicate that when I am using "import", I usually only import the types defined in the imported schema to declare elements or attributes in the importing schema.  Is it true that I can not refer to elements defined in the imported schema? If it is not true, is it fair to say that the importing schema now has elements from different target namespace?  How will document instance refer to elements that are from different namespaces in this case, do I have to declare xmlns for both namespaces and qualify the element names?


Received on Tuesday, 26 March 2002 10:15:00 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:55 UTC