吉林白城平台部队:xml文件转换问题

来源:百度文库 编辑:查人人中国名人网 时间:2024/05/07 09:07:47
我写了一个java程序,目的是将html文件转换成xml文件,现在可以在后台显示出转换的xml文件信息,但无法在c盘中把这个xml文件完整输出,打开c盘中的xml文件里只有一个<html> 图标,其它的都没有,(以下是主函数):
public static void main(String args[]) {

FileInputStream in;
FileOutputStream out;
Tidy tidy = new Tidy();
TestDOM t = new TestDOM();

try {
tidy.setMakeClean(true);
tidy.setXmlTags(true);
tidy.setXmlOut(true);
tidy.setXmlPi(true);
tidy.setXmlPIs(true);
tidy.setRawOut(true);
tidy.setDocType("fpi");
tidy.setFixComments(true);
tidy.setTidyMark(true);
in = new FileInputStream("C://WriteExample1.html");
out = new FileOutputStream("C://WriteExample1.xml");
Document doc=tidy.createEmptyDocument();
tidy.pprint(doc,out);
t.print(tidy.parseDOM(in, out));
in.close();
out.close();
}
catch ( IOException e ) {
System.err.println( e.toString() );
}
}

请问这是怎么回事啊?哪位高手能回答我的问题,谢谢啦!

我也想知道,哪位说说啊!!