Hi.
> Hi all I've successfully used JAXB on my own simple schemas and to go from
> Java to XML. Recently I attempted to deal with some schemas from
> http://www.optimizationservices.org/ These relate to formulating
> optimization (mathematical) problems into XML for farming out to a server.
> After dealing with some name collisions (mathematicians like to use short
> non-Java compliant names, like N and n) got their OSiL (Optimization
> Services Instance Language) schema through XJC (the version that comes with
> Netbeans 6.1RC2).
>
> Unfortunately, I then got Java compile errors for a missing symbol in a
> bunch of the generated get methods:
>
> public double getUb() {
> if (ub == null) {
> return InfinityD; <--- should be Double.POSITIVE_INFINITY;
> } else {
> return ub;
> }
> }
>
> XML Schema permit both INF (positive infinity) and -INF (negative infinity)
> but these don't seem to be getting mapped correctly to the Java (the INF and
> -INF values occur as defaults on a number of attributes in the Schema).
>
> Anyone else see this? Is this a bug (or a feature)? Any work around?
This was clearly a bug in the codemodel: doubles were generated in the
code as Double.toString(d) + "D" which results in "InfinityD" for
positive infinity.
I have filed and fixed an issue in the codemodel project:
https://codemodel.dev.java.net/issues/show_bug.cgi?id=7
Now you have two basic options:
1. Wait until the new codemodel version will be integrated into xjc.
2. Take the new codemodel binary and replace all the com.sun.codemodel
classes in your jaxb-xjc binary (like I did).
I've attached the new codemodel jar. Let me know if you need the
patched jaxb-xjc binary.
Bye.
/lexi