如何读取和执行一个大的xml文件

本文关键字:一个 xml 文件 执行 何读取 读取 | 更新日期: 2023-09-27 17:58:26

我的代码给我错误:"'.',十六进制值0x00,是无效字符。第2行,位置1。"

    string FileName = "20110606 100419 ServerForShop 1.xml";
    string root = Server.MapPath("~/Include/Xml Files/Patch/");       
    var custs = from c in XElement.Load(root + FileName).Elements("Update")
            select c;

我想读取并执行命令一个大的xml文件,大约是350MB,我怎么能读取它?这是我的xml文件结构:

<?xml version="1.0" encoding="utf-8"?>
<Update>
  <Object Name="Good">
    <Insert Table="Good">
      <Field Name="GoodCode" Value="1" Type="Integer" />
      <Field Name="GoodUserCode" Value="" Type="String" />
      .
      .
      .
    </Insert>
  </Object>
  </Update>

如何读取和执行一个大的xml文件

我建议在这里查找一些样本http://support.microsoft.com/kb/307548也许还有这里如何解析XML文件?