how to remove the warnings in Jtidy in java

前端 未结 5 1510
北荒
北荒 2021-01-13 20:18

I am using Jtidy parser in java.

URL url = new URL(\"www.yahoo.com\"); 
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
InputStream in = c         


        
5条回答
  •  甜味超标
    2021-01-13 21:14

    Looking at the Documentation I found a few methods which may do what you want.

    There is setShowErrors, setQuiet and setErrout. You may want to try the following:

    Tidy tidy = new Tidy();
    tidy.setShowErrors(0);
    tidy.setQuiet(true);
    tidy.setErrout(null);
    doc = tidy.parseDOM(in, null);
    

    One of them may be enough already, these were all the options I found. Note that this will simply hide the messages, not do anything about them. There is also setForceOutput to get the output, even if errors were generated.

提交回复
热议问题