Re: import

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 UTC