Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A HTML validator in Java [closed]

Tags:

java

html

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?

like image 320
Koerr Avatar asked Nov 18 '10 17:11

Koerr


People also ask

What does a HTML validator check?

This validator checks the markup validity of Web documents in HTML, XHTML, SMIL, MathML, etc. If you wish to validate specific content such as RSS/Atom feeds or CSS stylesheets, MobileOK content, or to find broken links, there are other validators and tools available.

How do you validate an HTML document?

The W3C HTML validatorValidate by URI: Allows you to enter the address of a page already on the internet for validation. Validate by File Upload: Allows you to upload an HTML file for validation. Validate by Direct Input: Allows you to paste the contents of an HTML file into the window for validation.


1 Answers

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

http://jtidy.sourceforge.net/

like image 163
Yada Avatar answered Sep 21 '22 02:09

Yada