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

Re: include vs. import

From: <Noah_Mendelsohn@lotus.com>
Date: Tue, 7 Mar 2000 22:03:10 -0500
To: "Sean Draine" <seandr@millisecond.com>
Cc: <www-xml-schema-comments@w3.org>
Message-ID: <OF144ED937.A4392182-ON8525689B.00514406@lotus.com>
Did you ever get an answer to this?  Keep in mind that a given XML schema 
document contributes declarations and definitions to (I.e. defines) at 
most one target namespace.  The difference between import and include is:

* import:  expresses that the "importing" schema is going to use 
definitions and declarations from some other designated target namespace. 
The processor can use its own conventions for finding the schema for the 
imported NS (e.g. an HTML editor might have a schema for HTML built in), 
but the import statement can provide a schema document location hint 
(schemaLocation attribute.)

* include:  strictly a packaging facility.  Lets you write the definition 
of a given target namespace in more than one document.  Include names the 
other document(s) to be used.  Include MUST name a document to be 
included, and the included document MUST have the same targetNS (if any) 
as the includer.

Hope this helps.

Noah Mendelsohn                                    Voice: 1-617-693-4036
Lotus Development Corp.                            Fax: 1-617-693-8676
One Rogers Street
Cambridge, MA 02142

"Sean Draine" <seandr@millisecond.com>
Sent by: www-xml-schema-comments-request@w3.org
02/22/00 01:00 PM

        To:     <www-xml-schema-comments@w3.org>
        cc:     (bcc: Noah Mendelsohn/CAM/Lotus)
        Subject:        include vs. import

I'm trying to understand the difference between including and importing a
namespace. From my reading of the spec, <include> brings all of the 
nodes directly into a single target namespace, allowing them to be
used/instanced without namespace qualifiers.  <import> allows a schema to
use foreign nodes that have a namespace different than its own. To
use/instance these foreign nodes, their namespace qualifier is required.

Is that it?

Sean Draine
Received on Tuesday, 7 March 2000 22:04:51 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:08:46 UTC