users@jaxb.java.net

Re: Global versus local binding customizations

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Mon, 05 Jan 2004 08:47:48 -0800

There has been a bug until 1.0.1 or so, where XJC didn't report some of
the customization errors correctly. We fixed them in a recent release,
and I believe what you are seeing is one of those.

According to the spec, the following is wrong:

    <xs:element name="NAME1" type="xs:string">
        <xs:annotation><xs:appinfo>
            <jxb:javaType
            name="java.lang.String"
            parseMethod="javax.xml.bind.DatatypeConverter.parseString"
            printMethod="javax.xml.bind.DatatypeConverter.printString"
            />
        </xs:appinfo></xs:annotation>
    </xs:element>

Instead, you have to write:

    <xs:element name="NAME1" type="xs:string">
        <xs:annotation><xs:appinfo>
            <jxb:property><jxb:baseType>
                <jxb:javaType
                name="java.lang.String"
                parseMethod="javax.xml.bind.DatatypeConverter.parseString"
                printMethod="javax.xml.bind.DatatypeConverter.printString"
                />
            </jxb:baseType></jxb:property>
        </xs:appinfo></xs:annotation>
    </xs:element>

I'm not exactly sure what's the rationale behind it, but I think this
should make it work.

Also, we just modified the error message for this error, so hopefully in
the future, you'll see a bit more friendly error messages.


regards,
--
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net