Re: question about mutual <import>ing

Did you get an answer to this?  Quick summary:  mutual importing is 
allowed.  What you import is a namespace, not a schema (most people seem 
to misunderstand this, but it's important).  Indeed:

        <!-- No schemaLocation on the following -->
        <import namespace="someNSURI"/>

is a useful and sensible thing to do.  The processor is expected to find 
the right schema for the namespace, perhaps from a command line or API 
argument.

The schemaLocations on imports are hints, which is (intentionally) 
symmetric with what happens if you first encounter the same namespace on 
an element in the instance, and that element has a schemaLocation hint. 
So, it doesn't matter whether you first hit a namespace in the instance 
(maybe from lax validation of <any>) or in an import, you can hit a 
schemaLocation hint.  Seeing a second import is like seeing a second use 
of the namespace:  you've presumably built up the schema you need for that 
namespace, and can do nothing with the 2nd import (there are obscure 
things you could in principle try with the second import, but I don't 
think one would actually want to do them.)  In general, <import> and what 
you see on an element when first encountering a NS are intentionally 
symmetric, whether or not a schemaLocation hint is provided.  It is 
anticipated that many processors will treat them symmetrically.  Hope this 
helps.

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







neilg@ca.ibm.com
Sent by: xmlschema-dev-request@w3.org
06/13/01 11:16 AM

 
        To:     xmlschema-dev@w3.org
        cc:     (bcc: Noah Mendelsohn/CAM/Lotus)
        Subject:        question about mutual <import>ing


Hello,

Consider a situation in which two schema documents contain <import>
information items which refer to one another.  Now suppose both schemas
contain references to components declared in the other schema.  I have two
questions:

1.  Is it valid for two schema documents to import one another?
2.  If the answer to 1. is yes, then is it also valid for both to contain
references to components declared in the other schema?

Please find attached an instance document and two schemas which exhibit
this behaviour.
(See attached file: bug2132.xml)(See attached file: bug2132A.xsd)(See
attached file: bug2132B.xsd)

Thanks for any help.
Neil Graham
XML Parser Development
IBM Toronto Lab
Phone:  416-448-3519, T/L 778-3519
E-mail:  neilg@ca.ibm.com

Received on Monday, 25 June 2001 14:02:24 UTC