We are wondering, how to tell a Marshaller to set a custom xsi:type (e.g. xsi:type=java:com.xxx.yyy) to a certain field.
Background: ---------- Our project consists of several modules. Several modules have different xml-schemas defined, but all of them share a basic structure. That's the reason why why define in one module (called base-module) this basic structure in a schema. This basic shema is then included from the other modules. We let castor generate from the schema all our classes. The classes from the base-module are generated in the base-module. The rest of the classes are generated in the other modules (without the basic classes, those have to be deleted with a maven post-goal, otherwise they are duplicated).
Our basic structure:
Envelope | +--Request | +--Response
Request and Response are abstract types.
In a specific module a Request can then be e.g. XRequest or YRequest; and a Response can be e.g. SResponse or TResponse.
Question -------- We want to tell the Marshaller that he sets the xsi:type of a certain field to the concrete java class of the specific module.
E.g. The field "request" of "Envelope" should be the xsi:type="java:com.xxx.module1.XRequest" (instead of xsi:type="Request" which takes the java class com.xxx.basicmodule.Request)
Our "vision" ------------
Envelope envelope = new Envelope(); //com.xxx.basicmodule.Envelope Marshaller marshaller = new Marshaller(outWriter); marshaller.setRootElement(ENVELOPE_TAG); //ENVELOPE_TAG = "envelope";
marshaller.marshal(envelope);marshaller.setXSITypeForElement("request","java:com.xxx.module1.XRequest");
Any idea how this could work ?
Kind regards
Frank Buchli
----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev
