5
Reply

Need help in parsing a huge XML file in windows application

Aisha Iyer

Aisha Iyer

Jan 3 2011 2:49 AM
13.1k

Hi,
     I have a huge XML file which is a collection of <fileDocument> nodes. I want to extract each <fileDocument> node and then extract the required field information from it. I am currently reading this file in a string which is so large that I can have only 1 copy of the string in memory. Even a Split operation on the string throws "Out of memory" exception. So I am using Substring() method to read each of the fileDocument node in loop. Is there a better data structure (than string) to read the XML file. Using XMLDocument() , throws an error that "0x1C Hexadecimal character found". So I am not able to use any XML functions on this XML file. Please help.
P.S. The reason for looking for an alternate data structure is to get an improvement in performance. Is there a way I can get that improvement using string itself?

Answers (5)