Re: Bug in XSV? ... reference without <import>

"Roger L. Costello" <costello@mitre.org> writes:

> Subject: Is it legal for a schema to reference a 
>          component in another namespace, when there
>          is no <import> element at the top of the
>          schema?
> 
> I have observed that XSV allows you to create a 
> schema which contains references to components in
> other namespaces, even though there is no <import>
> element.  Consider the following schema.
> 
> weather-station.xsd
> ----------------------------------------------------
> <?xml version="1.0"?>
> <xsd:schema xmlns:xsd="http://www.w3.org/2000/10/XMLSchema"
>             targetNamespace="http://www.weather-station.org"
>             xmlns="http://www.weather-station.org"
>             xmlns:s="http://www.sensor.org"
>             elementFormDefault="qualified">
>     <xsd:element name="weather-station">
>         <xsd:complexType>
>             <xsd:sequence>
>                 <xsd:element name="sensor" type="s:sensor_type" 
>                              maxOccurs="unbounded"/>
>             </xsd:sequence>
>         </xsd:complexType>
>     </xsd:element>
> </xsd:schema>
> ----------------------------------------------------
> 
> Note that the "sensor" element references a 
> sensor_type which is in another namespace, and note
> that there is no <import> element.
> 
> All the other schema validators that I tested 
> (xerces, oracle, XML Spy) do not accept this schema.

They are right, XSV is wrong.  This is _not_ a "you can wait until
runtime" issue.  See QName resolution (Schema Document) [1], the last
clause:

  "[the QName's] ·namespace name· is either the target namespace of the schema
  document containing the ·QName· or that schema document contains an
  <import> element information item the ·actual value· of whose
  namespace [attribute] is identical to that ·namespace name·."

ht

[1] http://www.w3.org/TR/xmlschema-1/#src-resolve
-- 
  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 Monday, 7 May 2001 07:18:18 UTC