法拉利试驾:jtidy转换html文件的问题

来源:百度文库 编辑:神马品牌网 时间:2024/05/02 07:39:55
我使用了jtidy在eclipse中写了java程序来将一个html文件转换成xml文件,但运行后系统总是把这个html文件中的不合理之处告诉我,并总是说:
Tidy (vers 4th August 2000) Parsing "InputStream"
line 10 column 1 - Warning: <table> lacks "summary" attribute
line 10 column 1 - Warning: missing </a> before <table>
line 58 column 1 - Warning: <table> lacks "summary" attribute
line 75 column 48 - Warning: <align> unexpected or duplicate quote mark
line 75 column 48 - Warning: <align> unknown attribute value "null"
line 76 column 7 - Warning: missing </align> before </form>
line 77 column 17 - Warning: <docs:> unknown attribute value "null"
line 77 column 17 - Error: <docs:> is not recognized!
line 77 column 17 - Warning: discarding unexpected <docs:>
line 86 column 59 - Warning: <docs:> unknown attribute value "null"
line 86 column 59 - Error: <docs:> is not recognized!
line 86 column 59 - Warning: discarding unexpected <docs:>
line 95 column 59 - Warning: <docs:> unknown attribute value "null"
line 95 column 59 - Error: <docs:> is not recognized!
line 95 column 59 - Warning: discarding unexpected <docs:>
line 105 column 57 - Warning: <docs:> unknown attribute value "null"
line 105 column 57 - Error: <docs:> is not recognized!
line 105 column 57 - Warning: discarding unexpected <docs:>
line 114 column 73 - Warning: <docs:> unknown attribute value "null"
line 114 column 73 - Error: <docs:> is not recognized!
line 114 column 73 - Warning: discarding unexpected <docs:>
line 125 column 59 - Warning: <docs:> unknown attribute value "null"
line 125 column 59 - Error: <docs:> is not recognized!
line 125 column 59 - Warning: discarding unexpected <docs:>
line 135 column 71 - Warning: <docs:> unknown attribute value "null"
line 135 column 71 - Error: <docs:> is not recognized!

InputStream: Doctype given is "-//W3C//DTD HTML 4.0 Transitional//EN"
InputStream: Document content looks like HTML proprietary
156 warnings/errors were found!

This document has errors that must be fixed before
using HTML Tidy to generate a tidied up version.

那请问jtidy不是能够自动纠错,并把html转换成xml文件么?我该怎么修改呢?我很着急,谢谢啦!

html代码不规范,tidy不能转换,没办法,它还达不到那么智能