A request for help with understanding the scope of an < import namespace />

Hello;

i need to provide an explanation for the behavior in the following
example and i cant find the definitive answer in the spec. any help would
be greatly appreciated.

i have a 'parent' xsd file that we'll call foo.xsd ( not his real name
:-) ) and it looks like this:

<schema targetNamespace="urn:bar:2001" xmlns="http://www.w3.org/2001/XMLSchema" 
        xmlns:bar="urn:bar:2001"
	xmlns:xml="http://www.w3.org/XML/1998/namespace"
        elementFormDefault="qualified" attributeFormDefault="unqualified">

 <import  namespace="http://www.w3.org/XML/1998/namespace"
          schemaLocation="./xml-1998.xsd"/>
        
 <include schemaLocation="./foobar-2001.xsd"/>
 <include schemaLocation="./bazbar-2001.xsd"/>

</schema>


the author of foo.xsd believes that the import namespace line in foo.xsd
should be sufficient for the namespace aware parts of foobar-2001.xsd
and bazbar-2001.xsd to be resolved.

this is a quote from this person:

* I don't understand why the insertion of the import to every
  sub-schema is the right implementation without a construct
  such as "#ifdef" in C++ to avoid collisions.

the current version of xerces2-j disagrees with him alot. :-)

it gets very unhappy and spews zillions of namespace based errors if i
dont put the import namespace line into each included schema.

this is a recent feature of xerces, and when i asked about it on the
xerces-j list it was asserted that this was the correct behavior.

i believe that the xerces gang is correct. but i am unsure, so i am asking
on this list because i feel like i'll get an authoritative answer.

i really need an authoritative answer because this is just about the very
last step before this major new xsd based specification goes out the door
and i only want to reply to this important person once with a
correct, succinct, answer.

a pointer to the place in the spec that calls this behavior out would be
wonderful.


thankyou so much.

johnu

Received on Tuesday, 26 March 2002 15:48:53 UTC