0

我在 XSD 架构中有一个元素:

<xsd:any processContents="skip"/>

是否可以通过 XJB 绑定切换processContents到?strict无需修改架构文件。可以将其设置为全局属性。我想得到:

@XmlAnyElement(lax = true)
protected Object any;

代替:

@XmlAnyElement
protected Element any;
4

1 回答 1

1

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?

于 2013-07-31T13:37:06.350 回答