【发布时间】:2010-04-26 12:45:32
【问题描述】:
你会采用什么路径来解析一个没有架构的大型 XML 文件(2MB - 20 MB 或更大)(我无法用 XSD.exe 推断一个,因为文件结构很奇怪,请检查 sn-p下面)?
选项
1) XML 反序列化(但如前所述,我没有架构,XSD 工具抱怨文件内容), 2)Linq到XML, 3) 加载到 XmlDocument 中, 4) 使用 XmlReader & stuff 手动解析。
这是 XML 文件 sn-p:
<?xml version="1.0" encoding="utf-8"?>
<xmlData date="29.04.2010 12:09:13">
<Table>
<ident>079186</ident>
<stock>0</stock>
<pricewotax>33.94000000</pricewotax>
<discountpercent>0.00000000</discountpercent>
</Table>
<Table>
<ident>079190</ident>
<stock>1</stock>
<pricewotax>10.50000000</pricewotax>
<discountpercent>0.00000000</discountpercent>
<pricebyquantity>
<Table>
<quantity>5</quantity>
<pricewotax>10.00000000</pricewotax>
<discountpercent>0.00000000</discountpercent>
</Table>
<Table>
<quantity>8</quantity>
<pricewotax>9.00000000</pricewotax>
<discountpercent>0.00000000</discountpercent>
</Table>
</pricebyquantity>
</Table>
</xmlData>
【问题讨论】:
-
en.wikipedia.org/wiki/ERP => ERP?
标签: .net xml xml-serialization