用于大型文件的Java XML Parser [英] Java XML Parser for huge files

查看:98
本文介绍了用于大型文件的Java XML Parser的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一个xml解析器来解析大约1.8 GB的文件。

因此解析器不应该将所有文件加载到内存中。

I need a xml parser to parse a file that is approximately 1.8 gb.
So the parser should not load all the file to memory.

有什么建议吗?

推荐答案

除了推荐的SAX解析之外,您还可以使用StAX API(一种SAX演化),包含在JDK中(包javax.xml.stream)。

Aside the recommended SAX parsing, you could use the StAX API (kind of a SAX evolution), included in the JDK (package javax.xml.stream ).

  • StAX Project Home: http://stax.codehaus.org/Home
  • Brief introduction: http://www.xml.com/pub/a/2003/09/17/stax.html
  • Javadoc: https://docs.oracle.com/javase/8/docs/api/javax/xml/stream/package-summary.html

这篇关于用于大型文件的Java XML Parser的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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