I want to create java code from xsd using JAXB 2.1 XJC. I have an xsd schema and I cannot change it. I would like to use xjc mode : simple when creating Java classes from an xml schema.
There are elements in xsd:
<xs:any namespace="##other" processContents="lax"/>
As stated here: http://jaxb.java.net/guide/Mapping_of__xs_any___.html I expected these elements to be bound to:
@XmlAnyElement(lax=true) public Object any;
but when I use xjc: simple binding mode, I have:
@XmlAnyElement protected Element any;
I tried to find a workaround, but everywhere he said that xs: any is processed without configuration. The only way to have xs: any element like java.lang.Object is to remove xjc: simple or change the processContents to "strict" in xsd. None of these options work for me now, since I cannot change the xml scheme, and I have some kind of legacy code that depends on the Java classes generated with xjc: simple mode, but now I need to use xs: any element, and I would like not to use org.w3c.dom.Element objects.
Any help would be greatly appreciated. Thanks.
source share