Import Issue

Having trouble installing Oxygen? Got a bug to report? Post it all here.
tdginn01
Posts: 2
Joined: Wed Apr 02, 2008 4:38 pm

Import Issue

Post by tdginn01 »

I have a schema that imports another schema from my project. For reference I have 7 other imports that work fine. On this particular import it comes up with an error that it couldn't find the specific type that I am trying to import. Though in the visual editor it shows the import and displays the node correctly. I am unable to generate java classes or sample xml because of this. I have included the import statment, the node, and some other pertinant code. Also this is the message I get.

Error (http://www.w3.org/TR/xml-schema-1, src-resolve) src-resolve: Cannot resolve the name 'conInfo:ContractInformationType' to a(n) 'type definition' component.
Top Level Schema Code

Code: Select all


<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:per="Person/v1.00"
xmlns:conInfo="ContractInformation/v1.00"
xmlns:rct="RecruiterInformation/v1.00" xmlns:someAp="someApInformation/v1.00"
xmlns:tns="SomeCandidate/v1.00" targetNamespace="SomeCandidate/v1.00"
xml:lang="EN" version="1.00">

<xs:import namespace="ContractInformation/v1.00"
schemaLocation="contract/ContractInformation.v1.00.xsd" />
<xs:element name="contractInfo" type="conInfo:ContractInformationType"
minOccurs="0" />
The Partial ContractInformation Schema Code

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:tns="ContractInformation/v1.00"
targetNamespace="ContractInformation/v1.00">
<xs:element name="ContractInformation" type="tns:ContractInformationType" />
<xs:complexType name="ContractInformationType">
<xs:sequence>
Any Assistance would be helpful
Last edited by tdginn01 on Thu Apr 03, 2008 6:47 pm, edited 1 time in total.
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Re: Import Issue

Post by george »

Hi,

Hmm... at a first look I cannot spot any problem except:

<xs:element name="contractInfo" type="conInfo:ContractInformationType"
minOccurs="0" />

where you have minOccurs on a global element declaration, that is clearly not allowed and you should get an error about that.

The best way further is if you can try to extract a cut down sample that can be used to reproduce the issue. In general the problem is found during the creation of the cut down sample.

One thing that can cause this is if you already import the namespace referring to another schema that does not defines that type and oXygen is configured in one schema per namespace mode, the default is to allow multiple schemas per namespace. The feature that controls one schema per namespace or multiple schemas per namespace is in Options->Preferences -- XML -- XML Parser -- http://apache.org/xml/features/honour-all-schemaLocations.

Best Regards,
George
George Cristian Bina
tdginn01
Posts: 2
Joined: Wed Apr 02, 2008 4:38 pm

Re: Import Issue

Post by tdginn01 »

Thanks alot that was it. I had the namespace referenced in another schema. I guess I should have came up with better names than contractInformation and contactInformation. I have stared at this code for a week and overlooked it.

Tim
Post Reply