"HTML response must have exactly one HEAD element, "
+ "found " + heads.getLength() + " : "
+ heads.toString(),
OpenIDException.DISCOVERY_HTML_PARSE_ERROR);
HTMLHeadElement head = (HTMLHeadElement) doc.getHead();
NodeList linkElements = head.getElementsByTagName("LINK");
for (int i = 0, len = linkElements.getLength(); i < len; i++)
{
HTMLLinkElement linkElement = (HTMLLinkElement) linkElements.item(i);
setResult(linkElement.getRel(), linkElement.getHref(), result);
}