public void buildDocument(InputStream is, Document doc)
throws DocumentHandlerException {
Tidy tidy = new Tidy();
tidy.setQuiet(true);
tidy.setShowWarnings(false);
org.w3c.dom.Document root = tidy.parseDOM(is, null);
Element rawDoc = root.getDocumentElement();
String title = getTitle(rawDoc);
String body = getBody(rawDoc);
if ((title != null) && (!title.equals(""))) {
doc.addField("title", title, StoreOption.YES, IndexOption.TOKENIZED);