RE: Mixing schemaLocation and noNamespaceSchemaLocation?

Roger Costello wrote:
>Question 1: can an instance document conform to multiple no-namespace
>schemas?  That is, is this legal:
>
>     xsi:noNamespaceSchemaLocation="BookCatalogue.xsd  Reviewer.xsd"
>
>where BookCatalogue.xsd and Reviewer.xsd are two no-namespace schemas.

Section 4.3.2, Item 3 says:

The second similiary provides a URI reference as a hint.... no targetNamespace.  "a URI reference" means only one.  [Maybe there is a place it is more explicit, but that was the first I found]

If you did this for namespace-less schema, then you really should allow it for namespaced-schemas for symetry.  I might have two schemas that each cover a separate partition of one namespace.
However, trying to decide if two schemas are complementary or duplicative would be a pain.  I think the one namespace == one schema resource (in a document) is the best approach.  You could still
partition your schemas, but you would have to create another schema that imported both BookCatalogue and Reviewer.

>Alternatively, is this legal:
>
>     xsi:noNamespaceSchemaLocation="BookCatalogue.xsd"
>     xsi:noNamespaceSchemaLocation="Reviewer.xsd"

Roger, you know better than this.  XML 1.0 does not allow multiple attributes with the same name on one element.

>Question 2: can an instance document conform to a no-namespace schema as
>well as a schema with a targetNamespace?  Is this legal in an instance
>document:
>
>     xsi:noNamespaceSchemaLocation="BookCatalogue.xsd"
>     xsi:schemaLocation="http://www.reviewer.org  Reviewer.xsd"

This should be legal.  Did you have a processor that did not support it?

Received on Thursday, 29 March 2001 14:15:36 UTC