I am new in Java. I want parse huge xml file for example 250 MB or more bigger than.But i dont know content. Can you suggest way,how will parse it? Thanks for help.
Asked
Active
Viewed 124 times
-1
-
2Hmm, what will you do with your parsed content? Show it on screen or just store as a different file? – Pphoenix Jul 01 '14 at 08:45
-
1possible duplicate of [parsing large XML using SAX in java](http://stackoverflow.com/questions/5681904/parsing-large-xml-using-sax-in-java) – Raedwald Jul 01 '14 at 09:02
-
See related question http://stackoverflow.com/questions/3969713/java-xml-parser-for-huge-files. – Mihai8 Jul 01 '14 at 09:42
1 Answers
1
You can parse the Xml file with a SAX or a DOM parser.
For large files you should use the SAX Parser, because then you dont need to load the whole file. Using this you will go trought the XML file.
For smaller files you can use a DOM parser. This one will load the file into a structure and then it will let you work with all of it.
Here you will find some information about both of them and the StAX parser. It is written in Java so it can meet your requirement.

Neso
- 86
- 5