History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: CASTOR-101
Type: Bug Bug
Status: Open Open
Priority: Critical Critical
Assignee: Unassigned
Reporter: purnendu_goswami
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
castor

SchemaException:An element declaration with the given name already exists

Created: 22/May/02 06:46 AM   Updated: 31/Mar/07 11:10 AM
Component/s: XML code generator
Affects Version/s: 0.9.3.9
Fix Version/s: None

Time Tracking:
Not Specified

Environment:
Operating System: All
Platform: PC

Bugzilla Id: 945


 Description  « Hide
We are using an industry standard XML schema and we are trying to use
Castor to generate XML to Java objects. We are getting the following error :
SchemaException:An element declaration with the given name
TransactionSetPurposeCode already exists

Part of our schema looks like:

<xs:element name="BeginningSegmentForTradingPartnerProfile">
<xs:annotation>
<xs:documentation>BTP Segment</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element ref="TransactionSetPurposeCode"/>
<xs:element ref="ReferenceIdentification"/>
<xs:element ref="TransactionTypeCode"/>
<xs:element ref="TransactionSetPurposeCode"
minOccurs="0"/>
> <xs:element
ref="ReferenceIdentification"
> minOccurs="0"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
>
> I guess the Castor program is complaing about element
> TransactionSetPurposeCode being referred twice. But is this an
invalid
> schema or this is a Castor limitation? This schema is also an
industry
> standard and not a home grown one. We need to find out about it as
soon as
> possible, because if this is a Castor problem, we need to think about
a
> different technology and we have a tight deadline...
>
> Really appreciate your help.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Arnaud Blandin - 06/Jun/02 07:40 AM
Hi,

this is a current limitation of the Castor SOM.
XML Schema allows to have the same element declarations in a <sequence>.
If you had a <choice> or an <all>, the schema would have been invalid


Richard - 15/May/03 09:14 AM
Do you have a deadline for solving this problem?
Thanks in advance
rich

Andrew Dunstan - 17/Jun/03 07:38 AM

I am getting this error in a slightly different way, where there is a choice of
two elements with the same name but from different namespaces, caused by this
schema fragment w.r.t. USStateCodeTypeElement:

<xsd:complexType>
<xsd:choice>
<xsd:element ref='fips_10-4:InternationalStateCodeTypeElement' />
<xsd:element ref='fips_5-2:USStateCodeTypeElement' />
<xsd:element ref='fips_5-2:USStateNumericCodeTypeElement' />
<xsd:element ref='ncic-st:LISTypeElement' />
<xsd:element ref='ncic-st:LSTATypeElement' />
<xsd:element ref='usps:USStateCodeTypeElement' />
</xsd:choice>
</xsd:complexType>

This has kinda stopped me dead in my tracks.


Werner Guttmann - 31/Mar/07 11:10 AM
Moving to XML code generation.