Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 333910

Summary: If namespace-specified package is used in schema gen, schema name is not used.
Product: [WebTools] Dali JPA Tools Reporter: Paul Fullbright <paul.fullbright>
Component: JAXBAssignee: Tran Le <tranle1>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: neil.hauge, tranle1
Version: 3.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows Vista   
Whiteboard:

Description Paul Fullbright CLA 2011-01-10 15:33:45 EST
When a schema is generated for a package with a specified namespace

   @XmlSchema(namespace="http://test.org")
   package test;

the namespace is used rather than the specified schema name for the generated schema.

For instance, I want the schema "test.xsd" to be generated, but the schema "test.org.xsd" is generated.
Comment 1 Tran Le CLA 2011-01-12 16:58:31 EST
This is working as specified in the bug 327151, where the given filename is the default name, and is only used when there is no namespace specified. Otherwise the namespace specified for the package will be used as filename.
Comment 2 Paul Fullbright CLA 2011-01-12 17:12:07 EST
I don't understand why I'm required to enter a schema name if it's not going to be used.

But beyond that, it doesn't allow me to modify the name of the schema, which might be necessary if I have an existing schema that I want to generate a second version of, not overwrite.
Comment 3 Neil Hauge CLA 2011-01-12 18:10:45 EST
(In reply to comment #2)
> I don't understand why I'm required to enter a schema name if it's not going to
> be used.
> 
> But beyond that, it doesn't allow me to modify the name of the schema, which
> might be necessary if I have an existing schema that I want to generate a
> second version of, not overwrite.

I think the final implementation referenced in comment 1 was a compromise regarding user choice and handling multiple namespaces.  I can't remember how we ended up there, but I think we decided that using the namespaces as schema names made more sense than using a user specified name with an index appended to the end (in the case of multiple namespaces).  Perhaps this needs more discussion.
Comment 4 Tran Le CLA 2011-01-24 14:59:37 EST
Work as designed.