in reply to Parsing with SAX an XML Document with no Root Node

Your problem is that your input files are not XML, XML files MUST have only one root node. All XML parsers are required to terminate if the input is not-well formed and if they are validating parsers then they also fail if the file is in-valid. Your file is not well formed and no XML parser will parse it, ever!

The only way to make this work is to cut your file up into logical chunks in their own <comp> nodes, or as you suggest put the whole file into it's own single root node. Which ever way you do it you must do it before you feed the data into the parser.

Why can't you load the file in, wrap it in a single root node and parse that? It easy easy to do.

Is there any reason why you can't load the file, and send each <comp> one at a time to the parser?

You may also wish to look at Tidy and xmllint which are tools that try to fix bad XML/HTML mark-up.