Issue Details (XML | Word | Printable)

Key: XMLBEANS-143
Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Major Major
Assignee: Unassigned
Reporter: Randy Thornton
Votes: 0
Watchers: 2
Operations

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

package name of generated code doesn't match targetNamespace

Created: 07/Apr/05 04:23 AM   Updated: 19/Oct/06 09:11 PM
Return to search
Component/s: Compiler
Affects Version/s: Version 2 Beta 1
Fix Version/s: None

Time Tracking:
Not Specified

Environment: Win XP, jdk1.4_2_03

Resolution Date: 14/Apr/05 07:57 AM


 Description  « Hide

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://www.perfretail.com/k2v1/report/schemas"
xmlns:rs="http://www.perfretail.com/k2v1/report/schemas"
xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
</xs:schema>

Note the package name contails k2v1 with a lowercase v. The generated classes contain an uppercase V and the directory structure created contains uppercase V also.

package com.perfretail.k2V1.report.schemas;







 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Radu Preotiuc-Pietro added a comment - 07/Apr/05 07:02 AM
In theory, you are right. At the time, we had to pick an algorithm for turning Xml names into Java package names, and this is what we picked. Now, there are probably better options around, but it would cause a real backwards compatibility problem if we changed the way we generate default names.
Maybe in the future we can add an XmlOption saying "use XmlBeansV1 default naming or JAXB2 default naming or JAX-RPC or what have you", but the default style has to be XmlBeansV1.
If you really care about the name that gets generated, you should probably use an .xsdconfig file to specifically map the names.

Randy Thornton added a comment - 07/Apr/05 08:32 AM
This, this issue can be closed. I will use the .xsdconfig file. Thanks.

Jacob Danner added a comment - 14/Apr/05 07:57 AM
User is fine with the workaround. Closing

Alexander Papaspyrou added a comment - 05/Sep/06 10:34 AM
I feel that this bug should fixed properly. I know of several people who failed deliberately using XMLBeans just because, by chance, their namespace statement contains numbers, and probably it's not their fault.

So documenting this issue in the farthest corners of Jira doesn't seem to be sufficient. Please reopen.

Radu Preotiuc-Pietro added a comment - 19/Oct/06 09:11 PM
How did they "fail"? As far as I know, the package name is still valid Java so it should not fail.
Changing the generated package names is covered in the XMLBeans FAQ under "General Questions -> Can I change the default package names for the java classes generated from my schema?"

Where would you rather see it documented?