Skip to main content

[XJC] silent failure with xs:enumeration

2 replies [Last post]
Joined: 2006-07-12

Hello all,

I run a Ant build under Netbeans 6.0.1, including a XJC task which looks like the following (target markup omitted):

The target XSD has many types, one is a simple type which is an enumeration based on a string type:

When running it through XJC, all the other types in the XSD are well transformed into Java classes, except this one. So what am I supposed to do if I must have a string-based enumeration which contains some numeric values I wish to get as strings? is it a bug?

Plus, XJC curiously does not show any compiling output. All I get is:

Compiling file:/foo.xsd
removing old output files
Writing output to foo/src
BUILD SUCCESSFUL (total time: 1 second)

It seems XJC is running in quiet mode (despite the -verbose option), even when an error like above is encountered. How can I fix this? In comparison, a wsimport task displays the name of all the generated classes...

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2006-11-09

I am having this problem also. I did note that if I use something like "X37"
it will work but "37X" will not. Did you get a reply on this?

Joined: 2006-11-09

I now understand why it won't work. It is because xjc generates an enum class
and an enum of 37 won't compile. I think the xjc should recognize this and generate something like this THIRTY_SEVEN("37");