12

I want validate HTML code in Java.

Like this:

HTMLValidator.validateHTML("aaa<b>bbb<b>");
// Returns false, because tag <b> is not closed

What Java libraries exist to do this?

2

1 Answer 1

21

You can try JTidy. JTidy is a Java port of HTML Tidy, a HTML syntax checker and pretty printer.

http://jtidy.sourceforge.net/

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.