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

RE: targetnamespace problem with XSV?

From: Tom Preston <tpreston@amadeusboston.com>
Date: Mon, 10 Dec 2001 12:38:59 -0500
Message-ID: <498B0C8F9141D511927B009027B11387368CDD@email-temp.vacation-corp.com>
To: Naomi Dushay <Naomi@cs.cornell.edu>, xmlschema-dev@w3.org
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'
' rootType='{http://DO}:DigitalObjectType' schemaErrors='0'
O -> DigitalObject.xsd' target='file:/C:/xml/DigitalObject.xml'
ct' version='XSV 1.204/1.109 of 2001/10/03 21:06:42'
<schemaDocAttempt URI='file:/C:/xml/DigitalObject.xsd' namespace='http://DO'
come='success' source='schemaLoc'/>

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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:14:56 UTC