次のように、JTidy を使用して一部の XML をクリーンアップしています。
Tidy tidy = new Tidy();
tidy.setXmlOut(true);
tidy.setShowWarnings(false);
tidy.parse(new FileInputStream(strStrippedHTMLPath), new FileOutputStream(strXMLPath));
問題は、常に次のように出力されることです。
InputStream: Document content looks like HTML 4.01
5 warnings, no errors were found!
何かを出力しないようにするにはどうすればよいですか? 私は試した:
tidy.setShowErrors(0);
tidy.setQuiet(true);
tidy.setErrout(null);
、ここに示すように、しかしそれもうまくいきませんでした。