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

Re: schema namespace error in xerces

From: Henry S. Thompson <ht@inf.ed.ac.uk>
Date: Thu, 20 May 2004 10:14:09 +0100
To: "Karen Smith" <KSmith@kevric.com>
Cc: <xmlschema-dev@w3.org>
Message-ID: <f5by8nna2am.fsf@erasmus.inf.ed.ac.uk>

Well, you haven't given quite enough information, but there's
something odd in what you _have_ provided:

<Device xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:hl7-org:v3 C:\\COCT_MT140000.xsd">

This says
  Device is in no known namespace
  A schema document for elements etc. in namespace "urn:h17-org:v3"
      can be found at C:\\COCT_MT140000.xsd

There are at least two potential problems here:

 1) The element is not in the namespace you say the schema document is
     for;
 2) C:\\COCT_MT140000.xsd is not a valid URI

I'm not sure which way to fix the first problem (either include
 xmlns="urn:h17-org:v3" on the Device element, or change to
 xsi:noNamespaceSchemaLocation), but I'm guessing you need/want the
namespace declaration.

Fix the second problem by using file:///C:/COCT_MT140000.xsd

Second set of possible problems:

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">

This does not specify a targetNamespace, that is, the namespace the
elements and types are being declared/defined in.  If this is
COCT_MT140000.xsd, then I'm guessing you need/want
targetNamespace="urn:hl7-org:v3", in which case you will at least need
to declare e.g. xmlns:h="urn:hl7-org:v3" and change

 type="COCT_MT140000.Device"

to

 type="h:COCT_MT140000.Device"
 
In other words -- make sure each of your schema documents, and your
instance document, have a consistent story about what namespace things
are in, as reflected by namespace declarations, qualified names,
xsi:schemaLocation, targetNamespace and include/import.

ht
-- 
 Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
                     Half-time member of W3C Team
    2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
            Fax: (44) 131 650-4587, e-mail: ht@inf.ed.ac.uk
                   URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]
Received on Thursday, 20 May 2004 05:16:54 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:44 GMT