我在单个文件中为多个记录获取 XML 数据。
如果我使用 XMLDocument 打开此文件,则表示格式无法识别。
有没有更好的方法来读取这个文件并作为每条记录进行处理。
下面是 XML 示例
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE NAXML-FuelsDoc SYSTEM "NAXML-FuelsDoc.dtd">
<NAXML-FuelsDoc version="1.0">
<TransmissionHeader>
<TransmissionId>616805428</TransmissionId>
<TransmissionDate>20171201</TransmissionDate>
<TransmissionTime>093100</TransmissionTime>
<TransmissionStatus actionType="original"/>
<TransmissionSender>Coffeyville Resources Refining Marketing</TransmissionSender>
<TransmissionReceiver>Desert Fuels Inc.</TransmissionReceiver>
<TransmissionAgency>DTN Energy Integrated Services/dtnDataConnect</TransmissionAgency>
</TransmissionHeader>
</NAXML-FuelsDoc>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE NAXML-FuelsDoc SYSTEM "NAXML-FuelsDoc.dtd">
<NAXML-FuelsDoc version="1.0">
<TransmissionHeader>
<TransmissionId>43234997</TransmissionId>
<TransmissionDate>20171201</TransmissionDate>
<TransmissionTime>093100</TransmissionTime>
<TransmissionStatus actionType="original"/>
<TransmissionSender>Coffeyville Resources Refining Marketing</TransmissionSender>
<TransmissionReceiver>Desert Fuels Inc.</TransmissionReceiver>
<TransmissionAgency>DTN Energy Integrated Services/dtnDataConnect</TransmissionAgency>
</TransmissionHeader>
</NAXML-FuelsDoc>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE NAXML-FuelsDoc SYSTEM "NAXML-FuelsDoc.dtd">
<NAXML-FuelsDoc version="1.0">
<TransmissionHeader>
<TransmissionId>54356923</TransmissionId>
<TransmissionDate>20171201</TransmissionDate>
<TransmissionTime>093100</TransmissionTime>
<TransmissionStatus actionType="original"/>
<TransmissionSender>Coffeyville Resources Refining Marketing</TransmissionSender>
<TransmissionReceiver>Desert Fuels Inc.</TransmissionReceiver>
<TransmissionAgency>DTN Energy Integrated Services/dtnDataConnect</TransmissionAgency>
</TransmissionHeader>
</NAXML-FuelsDoc>