这是XML,其中包含多个<itemX>
元素,例如<item1>
,<item2>
等...,X可以从1到n依次变化。
<?xml version="1.0"?>
<testxml>
<projects>
<item0>
<project_name>projectName1</project_name>
<project_tag>tagName</project_tag>
<room/>
<state>10</state>
<date_planned>0000-00-00</date_planned>
</item0>
<item1>
<project_name>projectName1/project_name>
<project_tag>tagName</project_tag>
<room>1</room>
<state>10</state>
<date_planned>0000-00-00</date_planned>
</item1>
<item2>
<project_name>ProjectName2</project_name>
<project_tag>tagname</project_tag>
<room>2</room>
<state>10</state>
<date_planned>0000-00-00</date_planned>
</item2>
</projects>
</testxml>
如何将此XML转换为JaxB Java对象?我被困在这里,不胜感激。