• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2405
  • Last Modified:

Target Namespace of an attribute declaration must not match XMLShema-instance

I'm new to XML and I've run into the following error (I'm using oXygen):

SystemID: \Desktop\XML Import2\xsi.xsd
Location: 6:40
Description: no-xsi: The {target namespace} of an attribute declaration must not match 'http://www.w3.org/2001/XMLSchema-instance'.
URL: http://www.w3.org/TR/xmlschema-1/#no-xsi

Below is a copy of the XSD document "xsi.xsd"

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
  targetNamespace="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:jxdm="http://www.it.ojp.gov/jxdm/3.0.2"
  xmlns:incident-doc="http://www.it.ojp.gov/jxdm/doc/incident/1.0/document"
  xmlns:incident="http://www.it.ojp.gov/jxdm/doc/incident/1.0/extension">
  <xs:import namespace="http://www.it.ojp.gov/jxdm/3.0.2"
    schemaLocation="sample-incident-report-simple.xsd"/>
  <xs:import namespace="http://www.it.ojp.gov/jxdm/doc/incident/1.0/document"
    schemaLocation="incident-doc.xsd"/>
  <xs:import namespace="http://www.it.ojp.gov/jxdm/doc/incident/1.0/extension"
    schemaLocation="incident.xsd"/>
  <xs:attribute name="schemaLocation"/>
</xs:schema>

Can you point me in the right direction?
Thanks,
0
Conkshell
Asked:
Conkshell
1 Solution
 
Geert BormansCommented:
Hi Conkshell,
> targetNamespace="http://www.w3.org/2001/XMLSchema-instance"

you cannot do that,
if you give the document a targetNamespace equal to the schema-instance namespace,
you are sort of overwriting that namespace, and you need it (though you only need it in the instance, not in the schema)

in targetNamespace, you should give the name of this specific schema's namespace
(actually this says, invent yourself a name, just make sure it is unique)

targetNamespace="urn:org:Conkshell:schemas:first-trial-schema" would work

Cheers!
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now