Re: [Neil Archer <neil.archer@viewgate.com>] [Moderator Action] Namepaces in schemas, where am I going wrong?

[Please subscribe to followup or ask other questions]

ht@cogsci.ed.ac.uk (Henry S. Thompson) writes:

> From: Neil Archer <neil.archer@viewgate.com>
> Subject: [Moderator Action] Namepaces in schemas, where am I going wrong?
> To: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>
> Date: Tue, 22 Aug 2000 05:41:31 -0400 (EDT)
> 
> Hi,
> 
> I am trying to use the XML schema shown below to validate an XML document
> using the data type timeInstance.
> 
> <?xml version='1.0'?>
> 
> <xsd:schema xmlns:xsd="http://www.w3.org/1999/XMLSchema"
>             xmlns:xdt="http://www.w3.org/1999/XMLSchema-datatypes">
> 
> 	<xsd:element name="service" type="Service"/>
> 
> 	<xsd:complexType name="Service">
> 		<xsd:element 	name="details" 	type="Details"
> minOccurs="1"/>
> 	</xsd:complexType>
> 
> 	<xsd:complexType name="Details">
> 		<xsd:element	name="type"		type="xsd:string"/>
> 		<xsd:element	name="start"	type="xdt:timeInstance"/>
> 		<xsd:element	name="stop"
> type="xdt:timeInstance"/>
> 	</xsd:complexType>
> 	
> </xsd:schema>
> 
> but when the validator I am using (Xerces 1.1.3) tries to validate the
> document it states that it cannot resolve URI : http:
> //www.w3.org/1999/XMLSchema-datatypes to a SchemaGrammar in
> getTypeInfoFromNS.
> 
> As I am new to XML I may well be missing something really obvious but I was
> under the impression that I had used the correct format to use the schema
> datatype timeInstance after giving it the alias of xdt.

My guess is that Xerces doesn't implement the relationship between
http://www.w3.org/1999/XMLSchema-datatypes and http://www.w3.org/1999/XMLSchema

However, there is no need or point in using
http//www.w3.org/1999/XMLSchema-datatypes in your situation, so just
get rid of the namespace declaration for the xdt prefix and change
xdt:timeInstance to xsd:timeInstance and you should be fine.

ht
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2001, part-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/

Received on Tuesday, 22 August 2000 06:44:32 UTC