users@jaxb.java.net

XSd key's and keyref's

From: Vincent Lamareille <vinc_at_sorengo.com>
Date: Sat, 10 Sep 2005 22:10:23 +0200

I want to synchronize via JAXB2.0 two instantiations of a same
datamodel, one in XML and another in objects managed by a java app.

For example, I have Shapes with their own data and a type which is a
ShapeAssembly. A ShapeAssembly with 2 Rectangles will reference 2
Rectangle instances, with the additional constraint that the length or
width of one must be equal to the length or width of the other.

Programmatically, it's easy to write.
In XML, it's not straightforward with IDs and IDREFS.

But it seems really intricated to express this simple constraint in XML
Schema with key's and keyref's and get it in code after compilation?

Has somebody a simple explanation for this problem?

Can I do it with jxb: annotations?

Thanks?