code: private boolean isFirstElemHTML()
      {
          boolean isHTML;
  
          // is the first tag html, not considering the prefix ?
          isHTML =
              getLocalNameUnknown(m_firstElementName).equalsIgnoreCase("html");
  
          // Try to rule out if this is not to be an HTML document based on URI
          if (isHTML
              && m_firstElementURI != null
              && !EMPTYSTRING.equals(m_firstElementURI))
          {
              // the <html> element has a non-trivial namespace
              isHTML = false;
          }
          // Try to rule out if this is an not to be an HTML document based on prefix
          if (isHTML && m_namespacePrefix != null)
          {
              /* the first element has a name of "html", but lets check the prefix.
               * If the prefix points to a namespace with a URL that is not ""
               * then the doecument doesn't start with an <html> tag, and isn't html
               */
              final int max = m_namespacePrefix.size();
              for (int i = 0; i < max; i++)
              {
                  final String prefix = (String) m_namespacePrefix.elementAt(i);
                  final String uri = (String) m_namespaceURI.elementAt(i);
  
                  if (m_firstElementPrefix != null
                      && m_firstElementPrefix.equals(prefix)
                      && !EMPTYSTRING.equals(uri))
                  {
                      // The first element has a prefix, so it can't be <html>
                      isHTML = false;
                      break;
                  }
              }
  
          }
          return isHTML;
      }
docs: Determine if the firts element in the document is <html> or <HTML>
  This uses the cached first element name, first element prefix and the
  cached namespaces from previous method calls
  
  @return true if the first element is an opening <html> tag