Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7640679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:43:51+00:00 2026-05-31T08:43:51+00:00

Question: How do i make xjc/Jaxb generate the propper javaclasses for several schemas containing

  • 0

Question:
How do i make xjc/Jaxb generate the propper javaclasses for several schemas containing duplicate elementdefinitions in the same namespace?

Information:
I have three .xsd schemas: A,B and C. All have the same targetnamespace.
They are all 3 shemas that has been given to me, and i am not, in any way possible, allowed to change them in any way.

They A has some elements that is also found in B or C (but A has a lot of self declared elements as well)
Example: This is the same “code” for A and C:

<xs:simpleType name="y_ym_ymdDatoType">
    <xs:union memberTypes="arcgYearType arcgYearMonthType arcDateType"/>
</xs:simpleType>
<xs:simpleType name="arcgYearType">
    <xs:restriction base="xs:gYear">
        <xs:minInclusive value="1700"/>
        <xs:maxInclusive value="2100"/>
    </xs:restriction>
</xs:simpleType>
<xs:simpleType name="arcgYearMonthType">
    <xs:restriction base="xs:gYearMonth">
        <xs:minInclusive value="1700-01"/>
        <xs:maxInclusive value="2100-12"/>
    </xs:restriction>
</xs:simpleType>
<xs:simpleType name="arcDateType">
    <xs:restriction base="xs:date">
        <xs:minInclusive value="1700-01-01"/>
        <xs:maxInclusive value="2100-12-31"/>
    </xs:restriction>
</xs:simpleType>

When using xjc to compile them into javaclasses, i get the following exception:

[ERROR] 'y_ym_ymdDatoType' is already defined
 line 297 of file:../c.xsd

[ERROR] (related to above error) the first definition appears here
 line 309 of file:../a.xsd

and the same happens to the other elements: arcgYearType, arcgYearMonthType and arcDateType.

I have read about a binding file that maybe could solve this problem, but i am not sure on how to do it so examples will be highly preferred.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T08:43:52+00:00Added an answer on May 31, 2026 at 8:43 am

    You can resolve conflicts manually using binding file. Here is the example, where you can specify your custom name for conflicting names:

    <bindings schemaLocation="../party.xsd" version="1.0" node="/xs:schema">
        <bindings node="//xs:complexType[@name='FixedIncomeBook']">
            <class name="PartyFixedIncomeBook"/>
        </bindings>
    </bindings>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does my question make sense? Using either Vim or Emacs, you come to understand
This question might make one smile, really, HDD space is as cheap as dirt
There's another question: howto make diff look like svn diff? but I want the
I am editing the question to make it more specific. I want to run
This might be a really stupid question and make you guys laugh. I've deployed
My question may not make sense but I have valid reason. We use .net
I have some question: How to make a role based web application? Such as
Follow up to this question about GNU make : I've got a directory, flac
I have to edit my question just to make it clear. What I need
Ok, so I'll try to make that question a little more simple. The core

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.