XJC xsd:any parsing

690 views Asked by At

I have an element in XSD schema:

<xsd:any processContents="skip"/>

Is it possible to switch processContents to strict through XJB binding? Without modifying schema file. May be set it as global property. I want to get:

@XmlAnyElement(lax = true)
protected Object any;

instead of:

@XmlAnyElement
protected Element any;
1

There are 1 answers

2
sgirardin On

You could totally change the annotation and the attribut's type. But beware if you generate your code from the XSD your modifications would be crushed.

Could you explain a little bit more your work context, needs and goals. Why can't you touch the XSD, do you generate classes from the XSD by JaxB? Do you use the XSD for validation purposes?