_log.debug("HTML discovery result:\n" + result);
}
private HTMLDocumentImpl parseDocument(String htmlData) throws DiscoveryException
{
OpenID4JavaDOMParser parser = new OpenID4JavaDOMParser();
try
{
parser.parse(OpenID4JavaDOMParser.createInputSource(htmlData));
}
catch (Exception e)
{
throw new DiscoveryException("Error parsing HTML message",
OpenIDException.DISCOVERY_HTML_PARSE_ERROR, e);
}
if (parser.isIgnoredHeadStartElement())
{
throw new DiscoveryException(
"HTML response must have exactly one HEAD element.",
OpenIDException.DISCOVERY_HTML_PARSE_ERROR);
}
return (HTMLDocumentImpl) parser.getDocument();
}