schema composition questions

Hello,

xsd:import and xsd:include seem straightforward to me until a mix of the
two is used and a "pipeline" of includes and imports is involved. I'd
like to ask a few questions to get things right:

Question #1:

Schema document A has target namespace "A", and contains top level names
"a1","a2",...,"aN".
Schema document B has no target namespace, and contains top level names
"b1","b2",...,"bN".
Schema document C has target namespace "C", and contains top level names
"c1","c2",...,"cN".

A includes B which imports C.

The composed Schema ABC now contains
	A:a1, A:a2, ..., A:aN
	A:b1, A:b2, ..., A:bN
	C:c1, C:c2, ..., C:cN

or is this situation illegal as include should not add new namespaces?!


Question #2:

Does the order in which xsd:import and xsd:include are being processed
have any significance in a schema document?
I mean, is processing
	<xsd:include schemaLocation="foo"/>
	<xsd:import schemaLocation="bar"/>
	<xsd:include schemaLocation="baz"/>
Always the same (from the perspective of the composed schemas at the end
of the process of composing the schemas) as 
	<xsd:include schemaLocation="baz"/>
	<xsd:include schemaLocation="foo"/>
	<xsd:import schemaLocation="bar"/>
or
	<xsd:include schemaLocation="baz"/>
	<xsd:import schemaLocation="bar"/>
	<xsd:include schemaLocation="foo"/>
Or some other ordering?

Question #3:

What is the correct or desired order of composing schemas when there is
more than one schema document that imports/includes some other schema
document?  Should the composition process start with the inner-most
schema document? Or should it start from the outer-most schema document?
Should this matter at all? (I vote for inner-most, but I don't know...)

If FOO schema document includes BAR schema document and BAR includes the
BAZ schema document. BAZ has no target namespace and it has a ref to a
name in BAR and a ref to a name in FOO. Is this OK? Should resolution of
names take place only when all documents are "available" and "visible"
or can the resolution process take place in phases and how?

Question #4:

What happens when the dependency graph of include/import of schema
documents contains circles? In this case, how does one know how deep to
go?


X <- Y <- Z <- W
And
W <- Z <- X
And
W <- Y

Every arrow (<-) means that the schema document on the left side
imports/includes the document on the right side.

It seems to me that depending on the operation, xsd:import or
xsd:include, some circles in the dependency graph should be easy to
resolve and some might be illegal. But what's the rule?


Question #5:

What is the coverage of xsd:any with regards to schema composition?

While I understand that namespace="##local" refers to the same schema
document (file) if it has no target namespace (is this correct?), what's
the scope about the other alternatives? Is the scope of the xsd:any
determined only once all schema documents are available and visible?



Thanks.

Shlomo.

Received on Wednesday, 4 July 2007 05:43:33 UTC