Archives

Parsing Large XML File Into ColdFusion XML Object

Last week I had a big headache trying to import a 165MB XML file. I couldn’t even open it with any browse and reading it with ColdFusion gave me 500 errors, exceeded heap size, JRun closed connection, etc…

The solution I found was to read the file line-by-line using Java and creating blocks of XML code that allowed me to parse into objects and process them individually. Remembering, we use CF7 yet.

So I wrote this piece of code where I set my start tag and it will grab everything between my start and end tag, and assemble a XML object from there. I know the CF Gurus would suggest a much better solution, but that’s what i could accomplish with my humble knowledge and give a quick solution for the problem.

Read More…