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"
elementFormDefault="qualified" attributeFormDefault="unqualified">
	<xsd:element name="DigitalObject" type="DigitalObjectType">
	<xsd:complexType name="DigitalObjectType">
			<xsd:element name="DataStream"
type="DataStreamType" minOccurs="0" maxOccurs="unbounded"/>
		<xsd:attribute name="DigitalObjectID" type="xsd:string"
	<xsd:complexType name="DataStreamType">
			<xsd:element name="descriptor"
		<xsd:attribute name="DSID" type="xsd:string"
use="required" id="DSID"/>

and the following instance doc:

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

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
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  

Received on Saturday, 8 December 2001 15:34:25 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:54 UTC