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 1037589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:52:10+00:00 2026-05-16T14:52:10+00:00

I am trying to generate java source files from a package of *.xsd files

  • 0

I am trying to generate java source files from a package of *.xsd files using the xjc code generation tool.

The namespaces used in those *.xsd files are as follows:

http://www.domain.com/foo/bar.x  
http://www.domain.com/foo/bar.x.y  
http://www.domain.com/foo/bar.x.y.z  

XJC produces packages as follows:

com.domain.foo.bar.x and places generated java files from “…x” and “…x.y” xsd namespaces there

com.domain.foo.bar.x_y and places generated java files from “…x.y.z” xsd namespaces there

What I would like to achieve here is proper:

com.domain.foo.bar.x  
com.domain.foo.bar.x.y  
com.domain.foo.bar.x.y.z package names  

Is this somehow possible? Maybe using custom JAXB bindings? I’ve studied jaxb custom binding docs but I am not sure if it’s possible.

Basically I would like xjc to treat both “/” and “.” as package separators.

Any help appreciated.

Adalbert

  • 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-16T14:52:10+00:00Added an answer on May 16, 2026 at 2:52 pm

    Use jaxb:package customization:

    <jaxb:bindings
        xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        jaxb:version="2.1">
    
        <jaxb:bindings schemaLocation="schema.xsd" node="/xsd:schema">
            <jaxb:schemaBindings>
                <jaxb:package name="com.domain.foo.bar.x.y.z"/>
            </jaxb:schemaBindings>
        </jaxb:bindings>
    </jaxb:bindings>
    

    Alternatively you could rename you namespace into http://www.domain.com/foo/bar/x/y/z.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to generate Java classes from several specific XSD's with xjc . Those
I am trying to generate Java documentation in Eclipse. The source files are UTF-8
I am trying to use jibx-maven plugin 1.2.3 for generating Java Source Code from
I'm trying to generate beans from an xsd by using the jaxb2-maven-plugin maven plugin,
I am trying to generate on-the-fly PDF reports from Java objects. I have not
Im trying to generate a color gradient using ColdFusion. My current code below works
I am trying to generate Java classes to bind xml to objects using castor.
I'm trying to generate a PDF document using FOP and Java. I receive the
I'm trying to generate Java service classes from a WSDL definition I have already
I am trying to generate java file from wsdlurl. some of them are working

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.