使用c#进行XML反序列化

时间:2015-06-15 12:56:21

标签: c# xml deserialization xml-deserialization

由于标签的名称,我遇到了关于XML反序列化的问题。

这是我的XML(每次程序启动时都会从网上导入(当然,使用不同的blablas和不同的计数))

<history xmlns:oslc_cm="blabla" oslc_cm:collref="blabla">
    <oslc_cm:totalCount>10</oslc_cm:totalCount>     
    <history rdf:resource="blabla"/>
    <history rdf:resource="blabla"/>
    <history rdf:resource="blabla"/>
    <history rdf:resource="blabla"/>
    <history rdf:resource="blabla"/>
    <history rdf:resource="blabla"/>
    <history rdf:resource="blabla"/>
    <history rdf:resource="blabla"/>
    <history rdf:resource="blabla"/>
    <history rdf:resource="blabla"/>
</history>

我需要&#34; blabla&#34;部分。如果外部有一个不同的名称,我将能够反序列化该文件,但在这里我不知道该怎么做,因为历史类中有历史类的列表。有什么想法吗?

修改
我知道如何定义类来反序列化XML文件。我对名称问题感到很难接受

0 个答案:

没有答案
相关问题