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

Import Vs. Include.

From: sunil <supadhye@cisco.com>
Date: Tue, 18 Jun 2002 08:42:53 -0400 (EDT)
To: <xmlschema-dev@w3.org>
Message-ID: <EKEHICGKCAIEGEDPLOGGGEJBCAAA.supadhye@cisco.com>




Hi
In my current csco_md_... xmlschema I have referenced another schema (the
ims schema) in the following way

   <xsd:schema xmlns:xsd=http://www.w3.org/2001/XMLSchema
            targetNamespace=”
http://www.cisco.com/elearning/xsd/ciscomd_v001
            xmlns=http://www.cisco.com/elearning/xsd/ciscomd_v001
            elementFormDefault=”qualified” version="csco_elearning Version
0.0.1">

            <xsd:import
namespace="http://www.imsglobal.org/xsd/imsmd_rootv1p2p2"
                                schemaLocation="imsmd_rootv1p2p2.xsd"/>


However, I read in documentation that I am supposed to do it differently.
That document says:
•       The include element allows you to access components in other schemas
-    All the schemas you include must have the same namespace as your schema
(i.e., the schema that is doing the include)
-   The net effect of include is as though you had typed all the definitions
directly into the containing schema

and gives the following example:
<xsd:schema …>
    <xsd:include schemaLocation="LibraryBook.xsd"/>
    <xsd:include schemaLocation="LibraryEmployee.xsd"/>
    …
</xsd:schema>


Which is right?  How should I include/import the ims schema, and what's the
difference between the way I did it and they did it?
Thanks.
Sunil
Received on Tuesday, 18 June 2002 10:37:55 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:31 GMT