Tim Driven Development | Test until the fear goes away
Tim Cooke wrote:Please don't use images to show errors. Please copy and paste the error as text into your posts.
Also, show the xml that is being parsed.
Alex Chun wrote:Sorry, I paste picture here. It's only a part of xml file.
Tim Driven Development | Test until the fear goes away
Tim Cooke wrote:
Alex Chun wrote:Sorry, I paste picture here. It's only a part of xml file.
Please don't do that. I cannot read anything in that image.
Just paste the part of the xml relevant to the error. What's on and around line 268?
Tim Driven Development | Test until the fear goes away
Tim Cooke wrote:I'm not sure how you could view that on a Windows machine. Perhaps someone else will be able to help with that.
On a *NIX machine I would suggest using sed to print out a small range of lines from the whole file. I don't know if you have sed on Windows, or some equivalent even.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Rob Spoor wrote:Without seeing line 268 we cannot see what's going wrong. All I can tell you is what the message says - you have an element that expects only text content but instead contains a nested element.
Tim Driven Development | Test until the fear goes away
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
Tim Holloway wrote:I suspect that you are running a 32-bit JVM.
In any event, I ALSO suspect that you're attempting to process a 1.7 GB file by loading the entire freaking thing into memory.
And that there's nothing necessarily wrong with the XML other than that there's simply too much of it.
That much data rarely needs to be (or should be!) processed in RAM directly. There are other ways to handle XML that allow you to process the XML as a stream instead of as one big indigestible lump. Consider using a SAX or STaX parser instead, and it you actually want to do complex things, you might store the received data into a database where it can be more efficiently accessed.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
Tim Holloway wrote:Well, if you can bring up the offending XML in your viewer program...
Alex Chun wrote:xml file is a big (~1.7GB). It does not open in textpad...It's one of problems. Editors can not open too large file.
Liutauras Vilda wrote:
Have you tried to download any other text editor as Notepad++, it should be able to handle files up to 2GB. Search for a different editor, surely there is some on Windows too.
Consider Paul's rocket mass heater. |