I have a very heavy XML file and I want to parse through it. First I want to open it on my browser and see the information it contains and how it is structured. But when I do that, I cannot scroll down. How can I open only a part of the file, there is repeating information so just opening a part of it could work. Any ideas?
Asked
Active
Viewed 438 times
2 Answers
1
Please don't say "very heavy" or "very big" or "huge": tell us the numbers. For some people, 2Mb is large, for others it is tiny.
Browsers aren't good at this: they like to hold an entire XML file as a tree structure in memory before displaying it (or before transforming it, e.g. using XSLT). For casual inspection of the file, you're best off using a command-line tool like more
(though this is not good at handling XML unless it's been formatted with newlines). To extract a part of the file, consider using a streamed XML processing tool such as XSLT 3.0, running it on the server rather than in the browser.

Michael Kay
- 156,231
- 11
- 92
- 164