code: public void validate(String html) throws ParserException {
  
          m_unbalancedClosedTags = 0;
          m_unbalancedOpenedTags = 0;
          m_rootElementCount = 0;
          m_stack.clear();
          m_messages.clear();
          Parser parser = new Parser();
          Lexer lexer = new Lexer();
          Page page = new Page(html, "UTF-8");
          lexer.setPage(page);
          parser.setLexer(lexer);
          // override built in composite tags to skip automatic tag closing
          PrototypicalNodeFactory factory = configureNoAutoCorrectionTags();
          lexer.setNodeFactory(factory);
  
          parser.visitAllNodesWith(this);
      }
docs: Validates the given HTML string.<p>
  
  @param html the HTML to validate
  
  @throws ParserException in case parsing fails