Open Tomas-Kraus opened 12 years ago
@glassfishrobot Commented Reported by mmaxey
@glassfishrobot Commented yaroska said: I wasn't able to find something about xsd order in the spec. We can plan an implementation of such improvement which will allow to put schemas in default order for the future releases.
@glassfishrobot Commented mmaxey said: I understand you have many issues to work and may want to think of this as an enhancement request. Let me make an argument for why this bug is very important to me.
I work with 300-400 XSDs where the build of these has been automated. This automation relies on being able to specify the list of XSDs by the directory name and/or in any order. Because of this bug, I must now insert some hacks into the automation that accounts for ordering. These hacks are going to be numerous because many our XSDs follow the pattern of the attached examples due to their high degree of interdependency.
Thank you for your assistance and thank you for considering my impact when assigning a priority to resolving this issue.
@glassfishrobot Commented newtopian said: I have a very similar issue here where I’m using the maven-jaxb2-plugin to generate code from xsd files.
I was able to track down the problem to namespace resolution. Basically the files have to be presented in such way that the order of the files represents the order of dependencies. I would expect the namespace resolver to be able to use the files in parameter as it would a catalog and to iterate the whole collection before failing to resolve a namespace.
As it stands we could summarize the situation as such: "In order to get XJC to parse and resolve namespaces in the xsd files I must first parse and resolve the xsd files to determine namespace dependencies. Then build the file list accordingly before passing over to xjc"
When viewed like this, I would more consider this a bug than enhancement. This being said, getting this fixed is to me far more important than the categorization semantics.
The maven-jaxb2-plugin seems to use the lexicographical order of files as the order provided to xjc. More details on the issue I raised over there https://github.com/highsource/maven-jaxb2-plugin/issues/98
Should you need more info, details or repro-steps for this issue please let me know.
Thanks.
@glassfishrobot Commented newtopian said: Possibly related issues :
@glassfishrobot Commented File: jaxb.zip Attached By: mmaxey
@glassfishrobot Commented Was assigned to yaroska
@glassfishrobot Commented This issue was imported from java.net JIRA JAXB-906
I have created a simplified example that shows that XJC is dependent on the order of the XSDs specified on the command line. In my example (attached), I have 3 XSDs in 2 namespaces:
The command below fails:
If I switch the order of A.xsd and B.xsd on the command line (making B.xsd first), it works:
Is this the expected behavior?
Affected Versions
[2.2.5]