Zoltan Varadi
Zoltan Varadi

Reputation: 2488

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. During conversion i get the following error:

line 1 column 1 - Warning: inserting missing 'title' element

InputStream: Document content looks like HTML 2.0

1 warning, no errors were found!

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

Upvotes: 3

Views: 787

Answers (1)

changer
changer

Reputation: 51

Try to force the output like the following, and it will return the forced result. tidy.setForceOutput(true).

Upvotes: 2

Related Questions