Community
Participate
Working Groups
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.
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.
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.
(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.
Work as designed.