C#使用相同的节点名称反序列化xml

时间:2018-09-19 18:44:29

标签: c# xml deserialization

我正在使用C#反序列化复杂的XML文件,但本节存在问题:

<?xml version="1.0" encoding="UTF-8" ?>
<applications>
    <CustomInformation name="DiscretionaryIncome">3036.50</CustomInformation>
    <CustomInformation name="CurrentLenderAccountNumber"/>
    <CustomInformation name="CurrentLenderRemainingPayments">0.00</CustomInformation>
    <CustomInformation name="CurrentLenderMonthlyPayment">0.00</CustomInformation>
    <CustomInformation name="CurrentLenderPayoff">0.00</CustomInformation>
    <CustomInformation name="AmountRequested">0.00</CustomInformation>
    <CustomInformation name="CurrentLenderInterestRate">0.00</CustomInformation>
    <CustomInformation name="CurrentLenderPhone"/>
    <CustomInformation name="CurrentLenderName"/>
    <CustomInformation name="LoanNumber"/>
    <CustomInformation name="DealerRegion">RateGenius</CustomInformation>
    <CustomInformation name="PrepaidFinanceCharge">0.00</CustomInformation>
    <CustomInformation name="Principal">0.00</CustomInformation>
</applications>

我需要获取对象的Attribute和值,但是由于这不是数组,所以我无法管理它。

我只能获取第一个节点的属性和值,但不能反序列化到下一个节点。

预先感谢

0 个答案:

没有答案