由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - Java XML parser的问题
相关主题
[转载] a question on XML parserhelp! XML parse problem
Java处理XMLjava & XML 2 example problem
哪位能大概介绍一下XML的那些API[ZT] choose your java xml parser
ETL process in JAVA. --有建议的请回这个贴。试着比较 JAXB/StAX/XStream/SAX
简单算法问题good java xpath parser
请问关于 Java XML processingneed help from the J2EE expert
CookXml 简介any JAXB high hands?
xml to PDF的packageJAXB
相关话题的讨论汇总
话题: dom话题: sax话题: xml话题: java话题: parse
进入Java版参与讨论
1 (共1页)
O**n
发帖数: 133
1
google了一下,发现java有DOM, 还有一种叫SAX的。据说DOM不好。
哪位大虾介绍一下吧,他们有什么区别呢?
如果我想用来parse一个巨大的xml的file, ~500MByte,
应该用哪一个?怎么用呢?
//bow
多谢!
st
发帖数: 1685
2
use SAX, which is single parse without building up the tree structure,
500M xml probably will bring DOM... (not enough memory)...
also, there are many many versions of DOM, SAX for java, check them
yourself. :D

【在 O**n 的大作中提到】
: google了一下,发现java有DOM, 还有一种叫SAX的。据说DOM不好。
: 哪位大虾介绍一下吧,他们有什么区别呢?
: 如果我想用来parse一个巨大的xml的file, ~500MByte,
: 应该用哪一个?怎么用呢?
: //bow
: 多谢!

e***g
发帖数: 158
3
depends on what you want to do after parse. don't use SAX unless you
have to, it's more work.

【在 O**n 的大作中提到】
: google了一下,发现java有DOM, 还有一种叫SAX的。据说DOM不好。
: 哪位大虾介绍一下吧,他们有什么区别呢?
: 如果我想用来parse一个巨大的xml的file, ~500MByte,
: 应该用哪一个?怎么用呢?
: //bow
: 多谢!

g*s
发帖数: 2277
4
or use JAXB to get flexibility of DOM and performance of SAX.

【在 e***g 的大作中提到】
: depends on what you want to do after parse. don't use SAX unless you
: have to, it's more work.

e***g
发帖数: 158
5
is it mature/popular yet? haven't heard of it for a while.
well it may not fit, if he wants to search by xpath, or to modify xml.
there's is no THE solution, it depends on what he wants to do.

【在 g*s 的大作中提到】
: or use JAXB to get flexibility of DOM and performance of SAX.
g*s
发帖数: 2277
6
still not mature? I used it two years ago for content conversion. did not
pay attention afterwards.hehe

【在 e***g 的大作中提到】
: is it mature/popular yet? haven't heard of it for a while.
: well it may not fit, if he wants to search by xpath, or to modify xml.
: there's is no THE solution, it depends on what he wants to do.

w********c
发帖数: 2632
7
It's an issue of the context. SAX is used for simplicity and speed, while DOM
is used for flexibility. If ur source is scanned only once, which is true in
most massive data processing, SAX is good enuf.

【在 e***g 的大作中提到】
: depends on what you want to do after parse. don't use SAX unless you
: have to, it's more work.

m**c
发帖数: 90
8

In general, if you are going to manipulate XML, you probably want to use DOM
so that you can insert/delete/update node in the DOM tree. If you are going
to parse XML only without any manipulation, you can use either DOM or SAX, but
SAX is faster comparing to DOM and uses less memory. In your case, you may
have to use SAX unless you have a lot memory.
DOM

【在 w********c 的大作中提到】
: It's an issue of the context. SAX is used for simplicity and speed, while DOM
: is used for flexibility. If ur source is scanned only once, which is true in
: most massive data processing, SAX is good enuf.

1 (共1页)
进入Java版参与讨论
相关主题
JAXB简单算法问题
XML schema to instance generator?请问关于 Java XML processing
What do you use to process XML?CookXml 简介
新手学习web service,有人想一起做点project吗?xml to PDF的package
[转载] a question on XML parserhelp! XML parse problem
Java处理XMLjava & XML 2 example problem
哪位能大概介绍一下XML的那些API[ZT] choose your java xml parser
ETL process in JAVA. --有建议的请回这个贴。试着比较 JAXB/StAX/XStream/SAX
相关话题的讨论汇总
话题: dom话题: sax话题: xml话题: java话题: parse