W3C home > Mailing lists > Public > xmlschema-dev@w3.org > April 2001

Re: import

From: <Noah_Mendelsohn@lotus.com>
Date: Tue, 24 Apr 2001 09:54:26 -0400
To: Ian Stokes-Rees <ijs@decisionsoft.com>
Cc: xmlschema-dev@w3.org
Message-ID: <OFFF75BFA4.FE0D841B-ON85256A37.00725B3E@lotus.com>
Ian Stokes-Rees writes:

>> is it legal to have two
>> "import" elements as follows 

>> <import namespace="http://foo" schemaLocation="libA.xsd"/>
>> <import namespace="http://foo" schemaLocation="libB.xsd"/>

Yes, legal...but keep in mind that any schemaLocation is just a hint, so 
two of them makes two hints.  Your processor may or may not choose to 
honor either or both.  By the way, per [1]:

>> <import namespace="http://foo" schemaLocation="libA.xsd"/>
>> <import namespace="http://foo" schemaLocation="libA.xsd"/>

is also legal, if not particularly desireable.  Quoting from the spec:

"NOTE: The above is carefully worded so that multiple importing of the 
same schema document will not constitute a violation of clause 2 of Schema 
Properties Correct (5.13), but applications are allowed, indeed 
encouraged, to avoid importing the same schema document more than once to 
forestall the necessity of establishing identity component by component. 
Given that the schemaLocation [attribute] is only a hint, it is open to 
applications to ignore all but the first import for a given namespace, 
regardless of the normalized value of schemaLocation, but such a strategy 
risks missing useful information when new schemaLocations are offered."

So, multiple imports are allowed.

[1] http://www.w3.org/TR/xmlschema-1/#composition-schemaImport

------------------------------------------------------------------------
Noah Mendelsohn                                    Voice: 1-617-693-4036
Lotus Development Corp.                            Fax: 1-617-693-8676
One Rogers Street
Cambridge, MA 02142
------------------------------------------------------------------------
Received on Tuesday, 24 April 2001 09:58:17 GMT

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