由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
XML版 - [转载] XML parsing problem
相关主题
[转载] XML questionRe: Please help! How to Program to Create an XML document with no root element?
About XML parserxml parser?
[转载] help! XML parse problem从哪里开始学习XML?
SAX and DOM parsers请问那有xml的parse source(bsd 或 lin..... 补充一句
用于 parse xml的scriptone simple question
[转载] a question on XML parserwhere to find some sample code of XML document creating and parsing with JAXP DOM?
problem with perl XML::Node moduleProcessing xml files
How to parse DTD structure?Validity
相关话题的讨论汇总
话题: xml话题: parsing话题: domparser话题: element话题: document
进入XML版参与讨论
1 (共1页)
s********t
发帖数: 4150
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
w******r
发帖数: 55
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();

1 (共1页)
进入XML版参与讨论
相关主题
Validity用于 parse xml的script
question on CGI and XML[转载] a question on XML parser
Re: where to find some sample code of XML document creating and parsing with JAXP DOproblem with perl XML::Node module
挖坑!How to parse DTD structure?
[转载] XML questionRe: Please help! How to Program to Create an XML document with no root element?
About XML parserxml parser?
[转载] help! XML parse problem从哪里开始学习XML?
SAX and DOM parsers请问那有xml的parse source(bsd 或 lin..... 补充一句
相关话题的讨论汇总
话题: xml话题: parsing话题: domparser话题: element话题: document