我一直在尝试使用JTidy来搜索一些在线内容,但是我遇到了这个恼人的错误,我不知道如何修复它或让JTidy忽略它:
InputStream: Doctype given is "-//W3C//DTD XHTML 1.0 Transitional//EN"
InputStream: Document content looks like XHTML 1.0 Transitional
630 warnings, 1 error were found!
This document has errors that must be fixed before
using HTML Tidy to generate a tidied up version.
这似乎是一个愚蠢的错误 - 并且没有其他错误,所以这似乎是阻止JTidy解析文档的错误。我正在从一个直接在HttpURLConnection之外的InputStream中解析它,我正在使用方法Tidy.parseDom。