Re: LC-116: Require declaration before use of schema location

Noah Mendelsohn wrote:

Specifically, the pertinent text likely to appear in the next working
draft of the structures specification is: 

"xsi:schemaLocation and xsi:noNamespaceSchemaLocation [attributes] can 
occur on any element. However, it is an error if such an attribute 
occurs after the first appearance of an element or attribute information 
item within element information item initially assessed for schema-validity 
whose [namespace URI] it addresses." 

------------------

I don't like the implications of at least my interpretation of the proposed text.  For example, if you were combining fragments of two different documents and ended up with something like:

<somedoc xmlns="http://www.example.com/namespace/ns1"
    xsi:schemaLocation="http://www.example.com/namespace/ns1 http://www.example.com/schema/schema1.xsd">
            <child xsi:schemaLocation="http://www.example.com/namespace/ns1 http://www.example.com/schema/schema1.xsd"/>
 </somedoc>

By my reading of the proposed text, the child element would raise an error since an xsi:schema attribute appears after the first instance of an element from the "ns1" namespace.

I don't think an xsi:schemaLocation should ever raise an error, since it is only a hint at the most.

I'll let you guys work on the phrasing, but basically I would suggest that:

1. If the namespace is used prior to the first schemaLocation specification for that namespace, schema location proceeds as if there were no schemaLocation hint  provided.
2. The first schemaLocation hint for a namespace in a document is the effective hint (with the not that if it appears after the first use of the namespace it is ignored).
3. Any subsequent schemaLocation hints for the same namespace are ignored.

Received on Friday, 22 September 2000 00:49:01 UTC