users@jaxb.java.net

Re: Response to: Customizing IDREF target type?

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Tue, 16 Mar 2004 12:15:47 -0800

> At the time of the last posting it sounded like there was no supported way
> to map a type to an IDREF. Is this still the case? Are there any
> solutions, supported or otherwise, that may address this problem?

There's no portable way to do it. IOW, the JAXB spec doesn't give you a
way to do it.

But the RI does. See the attached schema.

You can annotate ID/IDREF by using <xjc:idSymbolSpace> customization.
This comparts the ID space into logical sub spaces (by assuing that
IDREFs of a symbol space only refers to IDs in the same symbol space)

So you get the desired effect of getting the strong type.

Note that the validation still doesn't change, so in the example <foo>
and <bar> can't have the same name.

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