W3C home > Mailing lists > Public > xmlschema-dev@w3.org > November 2005

No, I Don't Want No Namespace!

From: Tyson Tate <tytate@cadrc.calpoly.edu>
Date: Mon, 21 Nov 2005 10:11:12 -0800
Message-ID: <43820DC0.50007@cadrc.calpoly.edu>
To: xmlschema-dev@w3.org

I'm having something of a cryptic namespace problem and I simply can't 
seem to worm my way out of it. Basically, I've been given XML files that 
I can not modify and I wrote a schema to match them. The xml files look 
something like the following:

<?xml version="1.0" encoding="UTF-8"?>
<Vessel xmlns="http://www.xyzcorp.com/Vessel" 

The related schema looks like so:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
elementFormDefault="unqualified" attributeFormDefault="unqualified">
	<xs:import namespace="http://www.xyzcorp.com/ctypes" 
	<xs:element name="Vessel" type="VesselType">
	<xs:complexType name="VesselType">
			<xs:element name="VesselBase" type="VesselBaseType"/>

My problem is that it doesn't validate. XMLSpy 2005 gives me this 
wonderfully useful error message: "Unexpected element 'VesselBase' in 
element 'Vessel'. Expected: VesselBase" (Isn't that helpful?) Using an 
in-house Java 1.5-based validation tool (uses the Java-supplied XML 
classes), I get: "XML Fatal Error: On line 2, column 329, the following 
fatal error occurred: cvc-elt.1: Cannot find the declaration of element 

Based on that second error message, I'm assuming this is a namespace 
issue. Am I wrong? Despite having worked with XML for months now, I 
still can't get namespaces straight. Very frustrating. :-/

Thanks in advance,
Tyson Tate
Developer, CADRC
Received on Wednesday, 23 November 2005 01:06:05 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:09 UTC