Redian新闻
>
[转载] XML parsing problem
avatar
[转载] XML parsing problem# XML - WWW明日之星
s*t
1
【 以下文字转载自 Java 讨论区,原文如下 】
发信人: SmartAgent (sigh...), 信区: Java
标 题: XML parsing problem
发信站: The unknown SPACE (Tue Jan 2 02:00:05 2001) WWW-POST
Trying to parse XML file with IBM's XML4J, but it just
doesn't work. Any masters to give some advice?
The code:
DOMParser parser = new DOMParser();
parser.parse("index.xml");
Document document = parser.getDocument();
Element doc = (Element)document.getDocumentElement();
...
The XML file: (It doesn't refer to the dtd file as it is,
but it won't work ei
avatar
w*r
2
what do you mean by "doesn't work"? no output at all? or
some error message?
first to make sure you have some important methods for DOM
parser to parse,
like switch(node.getNodeType){case ....; case ....}
all the handlers are not free lunch -- you gotta make them
yourself.

【在 s********t 的大作中提到】
: 【 以下文字转载自 Java 讨论区,原文如下 】
: 发信人: SmartAgent (sigh...), 信区: Java
: 标 题: XML parsing problem
: 发信站: The unknown SPACE (Tue Jan 2 02:00:05 2001) WWW-POST
: Trying to parse XML file with IBM's XML4J, but it just
: doesn't work. Any masters to give some advice?
: The code:
: DOMParser parser = new DOMParser();
: parser.parse("index.xml");
: Document document = parser.getDocument();

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