users@jaxb.java.net

creating a JAXBElement<String> from an xs:idref xml element

From: Chet Joswig <cjoswig_at_yahoo.com>
Date: Tue, 12 Feb 2008 06:48:52 -0800 (PST)

Hi,

I have a schema outside of my control that generates a field, ChainElement of type JAXBElement<Object>. The underlying xml has an element whose type is xs:idref. I'd like to marshall an object that contains multiple objects of this type. The marshalling process works as expected but the xml that's produced has these elements with type xs:string. The xml has the desired structure, but it doesn't validate against the schema because xs:idref is not of type xs:string.

If I modify my generated source to use the JAXBElement<String> then the marshalled xml conforms to the schema, however I prefer to not modify the model generated by xjc, but rather configure the binding file to generate this code. Is there an easy way to either force the generated source to use the JAXBElement<String> type or modify the marshaller to not explicitly specify the element's (incorrect) type?

Thanks in advance for any help,

Chet Joswig

       
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.