Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to validate very large XML files?

Tags:

xml

How can I validate a large XML file (>100mb)? I try to open it with IE, FX & GC and it either crashes or doesn't do anything.

like image 949
user363637 Avatar asked Sep 23 '11 11:09

user363637


1 Answers

xmllint --stream

Worked on a 1.2Gb file with memory limited to 500Mb:

ulimit -Sv 500000
xmllint --stream a.xml

Without --stream, Linux kills the process, and without ulimit, my computer jams.

I was not able however to get output from --xpath when using --stream: How to do command line XPath queries in huge XML files?

Tested in Ubuntu 14.04, xmllint version 20901.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!