我有以下响应作为 xml 我需要映射到 java 对象我尝试使用 jaxb、sax、dom 无法从下面的数据中获取 <FIELD NAME="strShipmentNo" VALUE="A134535" />
数据。请建议如何从下面的 xml 中检索数据
<DTDCREPLY>
<CONSIGNMENT>
<CNHEADER>
<CNTRACK>TRUE</CNTRACK>
<FIELD NAME="strShipmentNo" VALUE="A15082271" />
<FIELD NAME="strRefNo" VALUE="N/A" />
<FIELD NAME="strMode" VALUE="AIR" />
<FIELD NAME="strOrigin" VALUE="LEAK-PROOF ENGINEERING PVT.LTD, AHMEDABAD" />
<FIELD NAME="strOriginRemarks" VALUE="Received from" />
<FIELD NAME="strBookedOn" VALUE="08072009" />
<FIELD NAME="strPieces" VALUE="1" />
<FIELD NAME="strWeightUnit" VALUE="Kg" />
<FIELD NAME="strWeight" VALUE="0.020" />
<FIELD NAME="strDestination" VALUE="PUNE" />
<FIELD NAME="strStatus" VALUE="DELIVERY" />
<FIELD NAME="strStatusTransOn" VALUE="09072009" />
<FIELD NAME="strStatusTransTime" VALUE="1210" />
<FIELD NAME="strRemarks" VALUE="CO SEAL" />
<FIELD NAME="strNoOfAttempts" VALUE="" />
</CNHEADER>
<CNBODY>
<CNACTIONTRACK>TRUE</CNACTIONTRACK>
<CNACTION>
<FIELD NAME="strAction" VALUE="DISPATCHED" />
<FIELD NAME="strRemarks" VALUE="" />
</CNACTION>
<CNACTION>
<FIELD NAME="strAction" VALUE="RECEIVED" />
<FIELD NAME="strRemarks" VALUE="" />
</CNACTION>
<CNACTION>
<FIELD NAME="strAction" VALUE="DISPATCHED" />
<FIELD NAME="strRemarks" VALUE="" />
</CNACTION>
<CNACTION>
<FIELD NAME="strAction" VALUE="RECEIVED" />
<FIELD NAME="strRemarks" VALUE="" />
</CNACTION>
<CNACTION>
<FIELD NAME="strAction" VALUE="OUT FOR DELIVERY" />
<FIELD NAME="strRemarks" VALUE="" />
</CNACTION>
</CNBODY>
</CONSIGNMENT>
</DTDCREPLY>