c*****t 发帖数: 1879 | 1 【 以下文字转载自 Java 讨论区 】
【 原文由 coconut 所发表 】
All of the following refer to parsing XML, not writing XML document
itself.
I went through Sun's XML tutorial using SAX and have some
questions.
1. Does one really write those handlers by hand? It is just insane.
How in the world does one differentiate different elements since they
are just poured in to the same handler. if tree can work, but then
the performance can suck bad. DOM is slightly simpler, but still
traversing the tree is not simple (since | c*****s 发帖数: 214 | 2
DO NOT write handlers yourself, we already have excellent SAXParsers. Besides,
we have lots of tools based on that.
Why does performance of walking tree suck? Opening a file means walking
character by character.
DOM is based on SAX. SAX implements DOM.
Sure, everybody do this. Check out what other people is doing.
Yes. Actually you did it too without knowing it. Many software is doing
something with XML including windows, we just don't care.
Xerces, XML4J and JDOM(not follows standards from SUN
【在 c*****t 的大作中提到】 : 【 以下文字转载自 Java 讨论区 】 : 【 原文由 coconut 所发表 】 : All of the following refer to parsing XML, not writing XML document : itself. : I went through Sun's XML tutorial using SAX and have some : questions. : 1. Does one really write those handlers by hand? It is just insane. : How in the world does one differentiate different elements since they : are just poured in to the same handler. if tree can work, but then : the performance can suck bad. DOM is slightly simpler, but still
|
|