RE: targetnamespace problem with XSV?

It works for me.  It validates with strict validation.  Here is xsv output
that I get:

<?xml version='1.0'?>
<xsv docElt='{http://DO}DigitalObject' instanceAssessed='true'
instanceErrors='0
' rootType='{http://DO}:DigitalObjectType' schemaErrors='0'
schemaLocs='http://D
O -> DigitalObject.xsd' target='file:/C:/xml/DigitalObject.xml'
validation='stri
ct' version='XSV 1.204/1.109 of 2001/10/03 21:06:42'
xmlns='http://www.w3.org/20
00/05/xsv'>
<schemaDocAttempt URI='file:/C:/xml/DigitalObject.xsd' namespace='http://DO'
out
come='success' source='schemaLoc'/>
</xsv>


Tom
-----Original Message-----
From: Naomi Dushay [mailto:Naomi@cs.cornell.edu]
Sent: Friday, December 07, 2001 4:35 PM
To: xmlschema-dev@w3.org
Subject: targetnamespace problem with XSV?


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 Monday, 10 December 2001 12:39:00 UTC