W3C home > Mailing lists > Public > xmlschema-dev@w3.org > June 2004

Problem with schemas and namespaces

From: Martin Häcker <spamfaenger@gmx.de>
Date: Thu, 24 Jun 2004 23:08:28 +0200
Message-Id: <p06110400bd00ab3ba46c@[]>
To: xmlschema-dev@w3.org

Hi there,

we are getting some strange errors from xerxes 2.6.1 when we try to 
validate an xml against two schemas.

The error we get is: "Error on line 15 of document 
file:schemas/sla.xsd: src-resolve: Cannot resolve the name 
'topology:resource' to a(n) 'element declaration' component."

The relevant schemas are these:

--- topology.xsd ---
<?xml version="1.0"?>

	<xs:element name="topology" type="topology"/>

	<xs:complexType name="topology">
			<xs:element name="adcInfo" type="adcInfo" />
			<xs:element name="parent" type="xs:string" />
			     <!-- TODO: soll das hier ein richtiger 
Verweis sein? //-->
			<xs:element name="resource" type="resource" 
minOccurs="0" maxOccurs="unbounded" />
			<xs:element name="topology" type="topology" 
minOccurs="0" maxOccurs="unbounded" />

	<xs:complexType name="adcInfo">
				<xs:element name="clusterName" 
type="xs:string" />
				<xs:element name="url" type="xs:anyURI" />
             <xs:attribute name="id" type="id" use="required" />

	<xs:complexType name="resource">
				<xs:element name="earliestStart" 
type="xs:date" />
				<xs:element name="deadline" type="xs:date" />
				<xs:element name="duration" 
type="xs:duration" />
					<xs:element name="nodes" 
type="nodes" />
					<xs:element name="network" 
type="network" />

	<xs:simpleType name="id">
		<xs:restriction base="xs:decimal" />
		<!-- Wie auf zehn Stellen begrenzen? -->

	<xs:complexType name="nodes">
		<xs:attribute name="amount" type="xs:positiveInteger" 
use="required" />
		<xs:attribute name="architecture" use="required">
				<xs:restriction base="xs:string">
					<xs:enumeration value="x86" />
					<xs:enumeration value="PowerPC" />
					<xs:enumeration value="Alpha" />
					<xs:enumeration value="Opteron" />
					<xs:enumeration value="ia64" />
					<xs:enumeration value="Nokia NGage" />
					<xs:enumeration value="GBA" />
					<xs:enumeration value="680x0" />

	<xs:complexType name="network">
		<xs:attribute name="bandwidth" 
type="xs:positiveInteger" use="required" />
		<xs:attribute name="latency" type="xs:positiveInteger" />


--- sla.xsd ---
<?xml version="1.0"?>

     <xs:import namespace="urn:vrm-topology" schemaLocation="topology.xsd"/>

	<xs:element name="sla">
                 	<xs:element ref="topology:resource" 
maxOccurs="unbounded" />
				<xs:element name="price" type="xs:decimal" />
				<xs:element name="fine" type="xs:decimal" />
				<xs:element name="provider" type="party" />
				<xs:element name="client" type="party" />
                 <xs:element name="id" type="topology:id" />
             <xs:attribute name="id" type="topology:id" use="required" />

	<xs:complexType name="party">
			<xs:element name="name" type="xs:string" />
			<xs:element name="email" type="xs:string" />
         <xs:attribute name="id" type="topology:id" use="required" />


--- end ---

This problem seems to me as if xerxes cannot find the implementation 
topology.xsd, but I cannot understand this. I tried "topology.xsd" as 
the path (the files are in the same directory, I also tried a "file:" 
prefix, I tried absolute paths, urls to a local webserver and 
whatever I could imagine - same result.

Though whatever manual/howto I read, they always seem to suggest that 
declaring the namespace, importing them with xs:import and then just 
using it - is the right solution to the problem. :(

I gather that this is some really simple problem - as it always is 
when I get something wrong, but with three people staring at this for 
two days now we just don't get any further, plus searching the web 
didn't bring up anything that made us see the errors of our ways.

Thanks for any reply,
cu Martin

p.s.: Sorry if this is the wrong list, but I found  what I Think may 
be a related problem on this list, so I thought this should be ok. 
Sorry if I'm wrong. Reference: 
[ot]coder - hehe
Received on Thursday, 24 June 2004 17:11:37 UTC

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