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

targetnamespace problem with XSV?

From: Naomi Dushay <Naomi@cs.cornell.edu>
Date: Fri, 7 Dec 2001 16:35:14 -0500 (EST)
Message-ID: <706871B20764CD449DB0E8E3D81C4D4301F3010D@opus.cs.cornell.edu>
To: <xmlschema-dev@w3.org>
I have the following schema:


<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://DO" xmlns="http://DO"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
	<xsd:element name="DigitalObject" type="DigitalObjectType">
	</xsd:element>
	<xsd:complexType name="DigitalObjectType">
		<xsd:sequence>
			<xsd:element name="DataStream"
type="DataStreamType" minOccurs="0" maxOccurs="unbounded"/>
		</xsd:sequence>
		<xsd:attribute name="DigitalObjectID" type="xsd:string"
use="required"/>
	</xsd:complexType>
	<xsd:complexType name="DataStreamType">
		<xsd:sequence>
			<xsd:element name="descriptor"
type="xsd:string"/>
		</xsd:sequence>
		<xsd:attribute name="DSID" type="xsd:string"
use="required" id="DSID"/>
	</xsd:complexType>
</xsd:schema>

and the following instance doc:

<?xml version="1.0" encoding="UTF-8"?>
<DigitalObject DigitalObjectID="cornell/sampleDO" xmlns="http://DO"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://DO DigitalObject.xsd">
	<DataStream DSID="DS-2">
		<descriptor>description of image</descriptor>
	</DataStream>
	<DataStream DSID="DS-3">
		<descriptor>thumbnail of image</descriptor>
	</DataStream>
</DigitalObject>


and I get the following errors from XSV:

http://www.cs.cornell.edu/naomi/test/ns/sampleDO.xml:7:2: Invalid
cvc-complex-type.1.2.4: element {http://DO}:DataStream not allowed here
(1) in element {http://DO}:DigitalObject, expecting
['{None}:DataStream']:
http://www.cs.cornell.edu/naomi/test/ns/sampleDO.xml:7:2: Invalid
src-resolve: undeclared element {http://DO}:DataStream
http://www.cs.cornell.edu/naomi/test/ns/sampleDO.xml:10:2: Invalid
src-resolve: undeclared element {http://DO}:DataStream


But my instance doc validates fine with XMLSpy 4.0, and with Topologi
Schema Validator.

What's going on?  Is it a problem with a distinction between the
targetNamespace and the null Namespace in the schema?  is it a problem
with distinguishing between no namespace and the default namespace in
the instace doc (both of which have no prefix)?


BTW, these docs are stipped down -- my original schema is more
complicated, hence the apparently unnecessary use of "xsd:sequence."

- Naomi

Naomi Dushay
Cornell Digital Library Research Group
Department of Computer Science
Cornell University
4130 Upson Hall
Ithaca, NY 14853-7501  USA  

naomi@cs.cornell.edu
Received on Saturday, 8 December 2001 15:34:25 GMT

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