【发布时间】:2017-01-09 21:42:00
【问题描述】:
我有一个 XML 文档,其结构如下。 ReportRaw 表示 ReportConverted 的十六进制值。当我对此应用 JAXB 绑定时,我将获得一个表示 ReportId 的自定义复杂对象,其中包含 ReportRaw 和 ReportConverted 的两个子对象。
<Report>
<ReportId>
<ReportRaw>FA3</ReportRaw>
<ReportConverted>4003</ReportConverted>
</ReportId>
</Report>
我的应用程序不使用 ReportedRaw 值,因此我想简化生成的对象模型并将 ReportId 生成为报告对象上的整数。我该如何使用 jaxb 自定义绑定来执行此操作?
谢谢
【问题讨论】:
标签: xml xml-parsing jaxb