[jboss-dev-forums] [Design of JBossXB] - Re: 2 root elements question

alex.loubyansky@jboss.com do-not-reply at jboss.com
Wed Jan 7 06:42:20 EST 2009


XML schema can contain multiple top-level/root elements. The corresponding classes have to be annotated with @XmlRootElement.

The problem is at the moment JBossXBBuilder (which is a SchemaBinding producer) takes only one class (which may reference other classes annotated with @XmlRootElement).

Until support for binding a set of classes to the same SchemaBinding is supported, there could be a few workarounds/hacks:
- just introduce an artificial class (which doesn't have to have a representation in the xsd) that would reference your top-level classes;
- build separate SchemaBinding's for datasources and connection-factories and then merge them into one.

The first one should be easier. Adding support for that to JBossXBBuilder should not be a problem as well. I am not sure whether JAXB defines a standard way to do that.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4200046#4200046

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4200046



More information about the jboss-dev-forums mailing list