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.
如何验证大型XML文件(>100mb)?我试着用IE、FX和GC打开它,它要么崩溃,要么什么都不做。
11 个解决方案
#1
9
You can try using a command-line validator, for example xmlstarlet:
您可以尝试使用命令行验证器,例如xmlstarlet:
$ xmlstarlet validate bigfile.xml
#2
6
The only tool I know that combines a large file viewer and an XML validator for huge files is XML ValidatorBuddy . The file viewer doesn't load the complete file at once but it is possible to scroll and there is also XML syntax-coloring applied. The validation uses the SAX parser from Xerces and your document with >100mb shouldn't be a problem.
我所知道的唯一一个结合大型文件查看器和XML验证器的工具是XML ValidatorBuddy。文件查看器不会一次加载完整的文件,但是可以滚动,还可以应用XML语法着色。验证使用Xerces的SAX解析器,使用>100mb的文档应该不会有问题。
#3
6
xmllint --stream
xmllint——流
Worked on a 1.2Gb file with memory limited to 500Mb:
在1.2Gb的文件上工作,内存限制在500Mb:
ulimit -Sv 500000
xmllint --stream a.xml
Without --stream
, Linux kills the process, and without ulimit
, my computer jams.
没有——流,Linux就扼杀了进程,没有ulimit,我的电脑就会阻塞。
I was not able however to get output from --xpath
when using --stream
: How to do command line XPath queries in huge XML files?
但是,在使用时,我无法从xpath获得输出:如何在大型XML文件中执行命令行xpath查询?
Tested in Ubuntu 14.04, xmllint version 20901.
在Ubuntu 14.04中测试,xmllint版本20901。
#4
4
Oxygen XML has a HUGE FILE support that does validation
Oxygen XML有一个巨大的文件支持来进行验证
http://www.oxygenxml.com/#14.1Huge_XML_Files_Support
http://www.oxygenxml.com/ 14.1 huge_xml_files_support
#5
1
Liquid Studio Community Edition contains a Large File Editor which can also be used to validate XML files. Its not really got an upper limit on the size of the files you can open Terra-byte files open instantly on low spec machines, and its free.
液态Studio Community Edition包含一个大型文件编辑器,也可用于验证XML文件。它并没有一个上限的文件的大小,你可以打开terr -byte文件立即在低规格的机器上,它是免费的。
#6
0
In Java, and I'm sure in other languages, there are solutions for reading in an entire XML file and processing it as a complete DOM, and solutions that process the XML as a stream in an event-driven way. You would want the second kind of solution, which never loads the entire file in memory. See SAX for a Java solution to the problem.
在Java中,我确信在其他语言中,有读取整个XML文件并将其作为完整的DOM处理的解决方案,也有以事件驱动的方式将XML作为流处理的解决方案。您可能需要第二种解决方案,它不会在内存中加载整个文件。请参阅SAX以获得问题的Java解决方案。
#7
0
You could try the EditiX XML editor.
您可以尝试EditiX XML编辑器。
If you load your document into EditiX and there are problems with the XML, eg. mismatched opening and closing tags, the editor will still load the file and in the bottom right corner of the screen you'll see a number displayed in red eg. a red "5" means there are five errors in the document.
如果您将文档加载到EditiX中,并且XML存在问题,例如。不匹配的打开和关闭标签,编辑器仍然会加载文件,在屏幕的右下角你会看到一个红色的数字如。红色的“5”表示文档中有5个错误。
I've not tried a 100mb document but I've done over 15mb and it seemed quite happy.
我还没有尝试过100mb的文档,但是我已经尝试了超过15mb的文档,看起来很不错。
There's a free version.
有一个免费版本。
#8
0
in addition to dj_segfault's comment on phihag's answer, xmlstarlet is fortunately NOT dead. They've just released Version 1.3
除了dj_segfault对phihag答案的评论之外,xmlstarlet还没有死。他们刚刚发布了1.3版
If you want a decent commandlinetool that can manipulate xml, xmlstarlet is perfect (and pretty fast).
如果您想要一个能够操作xml的像样的命令工具,xmlstarlet是完美的(而且速度很快)。
#9
0
Windows Version of XML Starlet:
XML Starlet的Windows版本:
> xml val <xmlfile.xml>
#10
0
You can also use the XML Tools Plugin in Nodepad++, it has a function "Check XML Syntax now". It's simple to download and if you don't use Notepad++ already, it's a good reason to start!
您还可以使用Nodepad++ +中的XML工具插件,它有一个函数“检查XML语法”。下载很简单,如果你不使用Notepad++,这是一个很好的开始!
#11
-1
On Windows you can write a simple application based on .net platform. The System.Xml.XmlReader
class is capable of validating huge files. An example is in this answer: Validating an XML against referenced XSD in C#
在Windows上,您可以编写一个基于。net平台的简单应用程序。System.Xml。XmlReader类能够验证大型文件。答案中有一个例子:根据c#中引用的XSD验证XML
#1
9
You can try using a command-line validator, for example xmlstarlet:
您可以尝试使用命令行验证器,例如xmlstarlet:
$ xmlstarlet validate bigfile.xml
#2
6
The only tool I know that combines a large file viewer and an XML validator for huge files is XML ValidatorBuddy . The file viewer doesn't load the complete file at once but it is possible to scroll and there is also XML syntax-coloring applied. The validation uses the SAX parser from Xerces and your document with >100mb shouldn't be a problem.
我所知道的唯一一个结合大型文件查看器和XML验证器的工具是XML ValidatorBuddy。文件查看器不会一次加载完整的文件,但是可以滚动,还可以应用XML语法着色。验证使用Xerces的SAX解析器,使用>100mb的文档应该不会有问题。
#3
6
xmllint --stream
xmllint——流
Worked on a 1.2Gb file with memory limited to 500Mb:
在1.2Gb的文件上工作,内存限制在500Mb:
ulimit -Sv 500000
xmllint --stream a.xml
Without --stream
, Linux kills the process, and without ulimit
, my computer jams.
没有——流,Linux就扼杀了进程,没有ulimit,我的电脑就会阻塞。
I was not able however to get output from --xpath
when using --stream
: How to do command line XPath queries in huge XML files?
但是,在使用时,我无法从xpath获得输出:如何在大型XML文件中执行命令行xpath查询?
Tested in Ubuntu 14.04, xmllint version 20901.
在Ubuntu 14.04中测试,xmllint版本20901。
#4
4
Oxygen XML has a HUGE FILE support that does validation
Oxygen XML有一个巨大的文件支持来进行验证
http://www.oxygenxml.com/#14.1Huge_XML_Files_Support
http://www.oxygenxml.com/ 14.1 huge_xml_files_support
#5
1
Liquid Studio Community Edition contains a Large File Editor which can also be used to validate XML files. Its not really got an upper limit on the size of the files you can open Terra-byte files open instantly on low spec machines, and its free.
液态Studio Community Edition包含一个大型文件编辑器,也可用于验证XML文件。它并没有一个上限的文件的大小,你可以打开terr -byte文件立即在低规格的机器上,它是免费的。
#6
0
In Java, and I'm sure in other languages, there are solutions for reading in an entire XML file and processing it as a complete DOM, and solutions that process the XML as a stream in an event-driven way. You would want the second kind of solution, which never loads the entire file in memory. See SAX for a Java solution to the problem.
在Java中,我确信在其他语言中,有读取整个XML文件并将其作为完整的DOM处理的解决方案,也有以事件驱动的方式将XML作为流处理的解决方案。您可能需要第二种解决方案,它不会在内存中加载整个文件。请参阅SAX以获得问题的Java解决方案。
#7
0
You could try the EditiX XML editor.
您可以尝试EditiX XML编辑器。
If you load your document into EditiX and there are problems with the XML, eg. mismatched opening and closing tags, the editor will still load the file and in the bottom right corner of the screen you'll see a number displayed in red eg. a red "5" means there are five errors in the document.
如果您将文档加载到EditiX中,并且XML存在问题,例如。不匹配的打开和关闭标签,编辑器仍然会加载文件,在屏幕的右下角你会看到一个红色的数字如。红色的“5”表示文档中有5个错误。
I've not tried a 100mb document but I've done over 15mb and it seemed quite happy.
我还没有尝试过100mb的文档,但是我已经尝试了超过15mb的文档,看起来很不错。
There's a free version.
有一个免费版本。
#8
0
in addition to dj_segfault's comment on phihag's answer, xmlstarlet is fortunately NOT dead. They've just released Version 1.3
除了dj_segfault对phihag答案的评论之外,xmlstarlet还没有死。他们刚刚发布了1.3版
If you want a decent commandlinetool that can manipulate xml, xmlstarlet is perfect (and pretty fast).
如果您想要一个能够操作xml的像样的命令工具,xmlstarlet是完美的(而且速度很快)。
#9
0
Windows Version of XML Starlet:
XML Starlet的Windows版本:
> xml val <xmlfile.xml>
#10
0
You can also use the XML Tools Plugin in Nodepad++, it has a function "Check XML Syntax now". It's simple to download and if you don't use Notepad++ already, it's a good reason to start!
您还可以使用Nodepad++ +中的XML工具插件,它有一个函数“检查XML语法”。下载很简单,如果你不使用Notepad++,这是一个很好的开始!
#11
-1
On Windows you can write a simple application based on .net platform. The System.Xml.XmlReader
class is capable of validating huge files. An example is in this answer: Validating an XML against referenced XSD in C#
在Windows上,您可以编写一个基于。net平台的简单应用程序。System.Xml。XmlReader类能够验证大型文件。答案中有一个例子:根据c#中引用的XSD验证XML