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

Re: Mixing schemaLocation and noNamespaceSchemaLocation?

From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
Date: 13 Apr 2001 22:46:22 +0100
To: Ian Stokes-Rees <ijs@decisionsoft.com>
Cc: "Arnold, Curt" <Curt.Arnold@hyprotech.com>, "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>
Message-ID: <f5bn19k5v81.fsf@cogsci.ed.ac.uk>
Ian Stokes-Rees <ijs@decisionsoft.com> writes:

> > > Isn't the proper way of thinking about this that there is only one
> > > schema per namespace and that there are multiple schema documents
> > > describing that namespace?
> > 
> > Since schemas and schema documents are all there are, and we
> > schema-validate _an_ instance with _a_ schema, it must be the case
> > that we may have more than one namespace per schema.   What I think
> > the useful summary is that in any case where multiple schema documents 
> > are used to describe a namespace, a single schema document which
> > <include>s them all should also be provides, so that instances and
> > other schema documents can use a single URI to identify them.
> 
> I have to admit that this is a bit of a revelation to me, so I want to
> confirm:
> 
> Assertion #1: A particular instance document always corresponds to either
> no schema or one schema, but not multiple schemas.

Not at the same time.  In distinct schema validation episodes,
different schemas can be used to assess the same instance document.

> Assertion #2: That schema is specified by some combination of the instance
> document and the processing application.

Yes.

> Assertion #3: That schema may consist of multiple namespaces (since an
> instance document can consist of multiple namespaces).

Yes.

> Assertion #4: One schema document may define a subset of at most one
> namespace. (that subset may be the entire namespace, or may be no
> namespace, in the case of "null namespace" schema documents).

Yes, although your choice of words is odd.  A schema only addresses
the syntax of elements and attributes in a namespace, there are lots
of other things that might be defined about a namespace.

> Assertion #5: A single schema document must use <any namespace="..."/> to
> tie into other schemas.

That is one, but _not_ the only way -- a complex type definition may
for example reference element or attribute declarations from another
namespace by using an appropriately qualified value for the 'ref'
attribute.

> Assertion #6: An instance document must use xmlns:xxx="..." attributes to
> indicate changes in the namespace of portions of the document.

Well, see the Namespace REC for the details.  Default NS declarations
are OK too.

> I state these as assertions since I accept there may be errors or
> omissions.  The basic idea is that a set of instance documents can be
> defined to correspond to a schema.  That schema may cover multiple
> namespaces.  A schema document may only define a subset of a particular
> namespace (or no namespace), but may be combined with others schema
> documents in other namespaces to exhaustively define a single
> schema.

That's all pretty much correct.  I encourage you to reread the
relevant sections of the Primer [1]

ht

[1] http://www.w3.org/TR/xmlschema-0/
-- 
  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 Friday, 13 April 2001 17:46:37 GMT

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