Re: Import/Include question

Jeni Tennison <jeni@jenitennison.com> writes:

> Hi Henry,
> 
> >> Yes. When Schema A or Schema B get used, the schema validator
> >> constructs, in memory, one big schema that includes everything from
> >> Schema A, Schema B and Schema C. All the components can reference each
> >> other across physical file boundaries.
> >
> > Actually, not necessarily 'Yes'. Unless I'm confused, the target
> > namespace of schema document C must be different from that of schema
> > document A. So to allow references in schema document C to
> > components defined in schema document A, schema document C must
> > import schema document A's target namespace.
> 
> Now I'm confused :) If you use Schema A then I thought you got a
> schema information item consisting of the components from:
> 
>   Schema A
>   Schema B (through the import from Schema A)
>   Schema C (through the include from Schema B)
> 
> If you use Schema B then I thought you got a schema information item
> consisting of the components from:
> 
>   Schema B
>   Schema C (through the include from Schema B)
>   Schema A (through the import from Schema B)
> 
> I thought that what was important when resolving QName references was
> not the physical document, but rather the schema components of the
> schema information item during validation. But it wouldn't surprise me
> if I've missed something in the Rec?

No, Your summary is correct as far as it goes.  But <xs:import> has
two semi-distinct roles:

 Support location of schema document resources;
 Allow reference to components in other namespaces.

The latter is what's at issue:  a schema _document_ which references
names in namespace NN (!= to its own target namespace) _must_ have
  <xs:import namespace="NN" . . ./>
in it.  That's just a coherence condition on schema documents.

So the problem with the example was the schema _document_ C cannot
reference components in namespace A without its _own_ import
statement.

ht
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2001, part-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/

Received on Thursday, 17 January 2002 09:00:24 UTC