i have a fully annotated class and multiple xsds(each with a different set of fields)
and i wish to marshal according to the different xsds using the same class.
i would like to be able to control the marshaling/unmarshaling process and filter out some fields according to the xsd.
btw i am using cxf.
thanks,
Note: I’m the EclipseLink JAXB (MOXy) lead and a member of the JAXB (JSR-222) expert group.
If you use MOXy as your JAXB provider then you could have the model mapped to one XML schema via the standard annotations, and then adjust the mappings to match the other XML schemas using MOXy’s external mapping document (see: http://blog.bdoughan.com/2010/12/extending-jaxb-representing-annotations.html).
JAXBContext#1 – Created based on annotations to match schema #1JAXBContext#2 – Created based on annotations and mapping file #1 to match schema #2JAXBContext#3 – Created based on annotations and mapping file #2 to match schema #3The mapping file also allows you to have the annotations completely ignored if one of your schemas bares little resemblance to the others.