avatar
[转载] XML question# XML - WWW明日之星
c*t
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
avatar
c*s
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

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。