Java API that can verify whether a HTML document is well-formed or not -
this question has answer here:
is there java api within maven repository can parse html document , verify if well-formed or not?
update:
the code in program looks this:
url = "c:/users/user1/desktop/testhtml.html"; fileinputstream fi = new fileinputstream(url); tidy tidy = new tidy(); //tidy.setquiet(true); tidy.parse(fi, null); //tidy.parsedom(fi, fo); int tempwarnings = tidy.getparsewarnings(); int temperrors = tidy.getparseerrors();` the contents on html file this:
<html> <head> <title>this sample doc</title> </head> <body> <p> <b>this sample paragraph</b></p> however tidy doesn't give warnings or errors when doctype , missing.
Comments
Post a Comment