Import Vs. Include

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?

Thanks.

Chang 

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