使用JAXB使用选择复杂的数据类型



我有以下XML消息,我需要进行

<xs:complexType name="DataType">
   <xs:choice>
       <xs:element name="Ext_a_Data" type="ExtTest1DataType" />
       <xs:element name="Ext_b_Data" type="ExtTest2DataType" />
       <xs:element name="Ext_c_Data" type="ExtTest3DataType" />
   </xs:choice>
</xs:complexType>

我该如何处理?

@XmlElements注释用于映射选择结构。

  • http://blog.bdoughan.com/2010/10/jaxb-and-xsd-choice-xmlements.html

最新更新