我想通过使用 JAXB 解组将 XML 转换为 java。
这是我的employee.xml。我试图转换,但它显示错误 javax.xml.bind.UnmarshalException
<?xml version="1.0" encoding="UTF-8"?>
<deptname name="Research">
<employee>
<eid>r-001</eid>
<ename>Dinesh R</ename>
<age>35</age>
<deptcode>d1</deptcode>
<deptname>Research</deptname>
<salary>20000</salary>
</employee>
</deptname>
<deptname name="Sales">
<employee>
<eid>s-001</eid>
<ename>Kanmani S</ename>
<age>35</age>
<deptcode>d2</deptcode>
<deptname>Sales</deptname>
<salary>30000</salary>
</employee>
</deptname>
<deptname name="Delivery">
<employee>
<eid>d-001</eid>
<ename>Kanchana M</ename>
<age>35</age>
<deptcode>d3</deptcode>
<deptname>Delivery</deptname>
<salary>20000</salary>
</employee>
</deptname>
繁星coding
相关分类