简体   繁体   English

jTidy html to xhtml返回空文件

[英]jTidy html to xhtml returns empty file

I'm trying to create an xhtml file from an html file, but i'm facing an error. 我正在尝试从html文件创建一个xhtml文件,但我遇到了一个错误。 During conversion i get the following error: 在转换过程中,我收到以下错误:

line 1 column 1 - Warning: inserting missing 'title' element 第1行第1列 - 警告:插入缺少的'title'元素

InputStream: Document content looks like HTML 2.0 InputStream:文档内容看起来像HTML 2.0

1 warning, no errors were found! 1警告,没有发现错误!

my code is the following: 我的代码如下:

Tidy tidy = new Tidy(); //HTML parser and pretty printer. 
tidy.setXHTML(true); //true if tidy should output XHTML   
tidy.parse(fin, fout);

At the end i receive an empty file. 最后我收到一个空文件。 What am i doing wrong? 我究竟做错了什么?

Sincerely, Zoli 真诚的,佐利

Try to force the output like the following, and it will return the forced result. 尝试强制输出如下,它将返回强制结果。 tidy.setForceOutput(true). tidy.setForceOutput(真)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM