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,
ConkshellAsked:
Who is Participating?
 
Geert BormansInformation ArchitectCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.