如何验证非常大的 XML 文件? [英] How to validate very large XML files?

查看:41
本文介绍了如何验证非常大的 XML 文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何验证大型 XML 文件 (>100mb)?我尝试用 IE、FX & 打开它GC,它要么崩溃,要么什么都不做.

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.

推荐答案

xmllint --stream

处理内存限制为 500Mb 的 1.2Gb 文件:

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

ulimit -Sv 500000
xmllint --stream a.xml

如果没有 --stream,Linux 会终止进程,如果没有 ulimit,我的电脑会卡住.

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

但是,在使用 --stream 时,我无法从 --xpath 获得输出:如何在巨大的 XML 文件中进行命令行 XPath 查询?

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

在 Ubuntu 14.04、xmllint 版本 20901 中测试.

Tested in Ubuntu 14.04, xmllint version 20901.

这篇关于如何验证非常大的 XML 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆