* @param source A string containing the HTML
*/
// XXX: also can be called statically, returns a DOMDocument in that case
public boolean loadHTML(Env env, String source)
{
ReadStream is = StringStream.open(source);
try {
getImpl().parseHTMLDocument(_delegate, is, null);
_delegate.setXmlStandalone(true);
/**
* XXX:
_delegate.setDoctype(new QDocumentType("html",
"-//W3C//DTD HTML 4.0 Transitional//EN",
"http://www.w3.org/TR/REC-html40/loose.dtd"));
*/
}
catch (SAXException ex) {
env.warning(ex);
return false;
}
catch (IOException ex) {
env.warning(ex);
return false;
}
finally {
if (is != null) {
is.close();
}
}
return true;
}