RE: HTML5+ITS validator

Hi Phil,

> Are there any code samples for doing this? 
> I couldn't find any on the web site.

It's quite easy to use the library.

Create a HtmlDocumentBuilder object:

HtmlDocumentBuilder docBuilder = new HtmlDocumentBuilder();

Then parse the input document:

Document doc = docBuilder.parse(new File("myFile.html"));

And your DOM tree is in doc.
After that it's normal XML DOM handling.

If it's any help, the source code for our filter is here:
http://code.google.com/p/okapi/source/browse/okapi/filters/its/src/main/java/net/sf/okapi/filters/its/html5/HTML5Filter.java?name=html5

cheers,
-yves

Received on Thursday, 13 September 2012 14:21:36 UTC