What is the best way to parse large XML (size of 1GB) in C#?

后端 未结 5 660
死守一世寂寞
死守一世寂寞 2020-12-03 11:13

I have a 1GB XML file and want to parse it. If I use XML Textreader or XMLDocument, the result is very slow and some times it hangs...

5条回答
  •  误落风尘
    2020-12-03 12:06

    XMLTextreader isn't supposed to hang as it's stream based and just works on chunks of the data.

    If it hangs, it may well be that you are doing something wrong when loading the file.

提交回复
热议问题