users@jaxb.java.net

Re: [JAXB-1.x] Error while setting <jaxb:javaType> to 'java.lang.Long' for element of type='xsd:ID'

From: Kostis Anagnostopoulos <ankostis_at_gmail.com>
Date: Tue, 22 Aug 2006 16:27:34 +0300

Hi Kohsuke,

On 8/22/06, Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_sun.com> wrote:
> Kostis Anagnostopoulos wrote:
> > I then tried to set 'parse' and 'print' methods and no exception this
> > time, but the XJC screamed something like this (not the eaxct error,
> > don't just search it up in the codebase):
> > [ERROR] the <xjc:idSymbolSpace> was not used!
> >
> > I think the <xjc:idSymbolSpace> should support types other than
> > String. (Dbs use numeric ids, so it is a common requirement).
>
> I think symbol space support is datatype agnostic, but I guess I have to
> check.
>
> A test case and an issue in the issuetracker would be appreciated, as usual.

Filed jaxb issue 225, and in this mail i have attached a mvn project
ready to use.

Just untar it, and enter mvn compile, and the error gets produced.
To fix it, look at the comments at the <jaxb:globalBindings> of the file:
  IdSymbolSpace/mod_xml/srv/main/resources/xsd/idsymbolspace.xjb

>
> Also, you might know already, but xs:ID and xs:IDREF derives from
> NCName, so tokens like "1" or "2" are not valid IDs. So your documents
> won't validate.

 Of course i have taken notice of it - w3c seems to do away with dbs
once and for all :-).
The parse/Print methods of the javaType could, for instance, append a
String preffix ahead of each numeric. I couldn't tested though.

Hope that helps,
  Kostis

>
> --
> Kohsuke Kawaguchi
> Sun Microsystems kohsuke.kawaguchi_at_sun.com
>
>
>