users@jaxb.java.net

Circular Reference Error?

From: MrMasha <craig.marshall_at_uk.experian.com>
Date: Mon, 27 Oct 2008 05:06:13 -0700 (PDT)

I am trying to split some common JAXB schemas into seperate Netbeans modules
in a prototype and getting the following error when trying to build the
classes for a ParentObject (the error is strange and I presume some sort of
reference error as the line number does not actually exist?)

As always any help appreciated!

[ERROR] 'LibraryCard' is already defined
  line 14 of
file:/C:/Experian-Scorex/IDAP%20Prototype/Component%20-%20Framework/src/com/experian/component/framework/transformation/schema/LibraryCard.xsd

[ERROR] (related to above error) the first definition appears here
  line 6 of
file:/C:/Experian-Scorex/IDAP%20Prototype/Component%20-%20Framework/src/com/experian/component/framework/transformation/schema/LibraryCard.xsd


1) LibraryCard.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            targetNamespace="http://xml.netbeans.org/schema/LibraryCard"
            xmlns:tns="http://xml.netbeans.org/schema/LibraryCard"
            elementFormDefault="qualified">
    <xsd:complexType name="LibraryCard">
        <xsd:sequence>
            <xsd:element name="Name" type="xsd:string"/>
            <xsd:element name="URL" type="xsd:string"/>
            <xsd:element name="ComponentType" type="xsd:string"/>
            <xsd:element name="public" type="xsd:boolean"></xsd:element>
        </xsd:sequence>
    </xsd:complexType>
</xsd:schema>

2) ComponentObject.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            targetNamespace="http://xml.netbeans.org/schema/ComponentObject"
            xmlns:tns="http://xml.netbeans.org/schema/ComponentObject"
            elementFormDefault="qualified"
            xmlns:ns1="http://xml.netbeans.org/schema/LibraryCard">
    <xsd:import schemaLocation="LibraryCard.xsd"
namespace="http://xml.netbeans.org/schema/LibraryCard"/>
    <xsd:complexType name="ComponentObject">
        <xsd:sequence>
            <xsd:element name="LibCard" type="ns1:LibraryCard"/>
        </xsd:sequence>
    </xsd:complexType>
</xsd:schema>

3)ParentObject.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            targetNamespace="http://xml.netbeans.org/schema/ParentObject"
            xmlns:tns="http://xml.netbeans.org/schema/ParentObject"
            elementFormDefault="qualified"
            xmlns:ns="http://xml.netbeans.org/schema/ComponentObject"
            xmlns:ns1="http://xml.netbeans.org/schema/LibraryCard">
                
    <xsd:import schemaLocation="../../../../../../../../Component -
Framework/src/com/experian/component/framework/transformation/schema/ComponentObject.xsd"
namespace="http://xml.netbeans.org/schema/ComponentObject"/>
    <xsd:import schemaLocation="../../../../../../../../Component -
Framework/src/com/experian/component/framework/transformation/schema/LibraryCard.xsd"
namespace="http://xml.netbeans.org/schema/LibraryCard"/>
    
    <xsd:complexType name="ParentObject">
        <xsd:complexContent>
            <xsd:extension base="ns:ComponentObject">
                <xsd:sequence>
                     <xsd:element name="SegmentationObject"
maxOccurs="unbounded" type="ns1:LibraryCard"></xsd:element>
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>
    <xsd:element name="ParentObject" type="tns:ParentObject"/>
</xsd:schema>
-- 
View this message in context: http://www.nabble.com/Circular-Reference-Error--tp20186407p20186407.html
Sent from the java.net - jaxb users mailing list archive at Nabble.com.