Пример #1
0
  private HtmlParseResult parse(FileObject file) throws ParseException {
    HtmlSource source = new HtmlSource(file);
    HtmlParseResult result = SyntaxAnalyzer.create(source).analyze().parseHtml();

    assertNotNull(result);

    assertNodeOffsets(result.root());

    return result;
  }
Пример #2
0
  private HtmlParseResult parse(CharSequence code, boolean validateNodes) throws ParseException {
    HtmlSource source = new HtmlSource(code);
    final HtmlParseResult result = SyntaxAnalyzer.create(source).analyze().parseHtml();

    assertNotNull(result);

    if (validateNodes) {
      assertNodeOffsets(result.root());
    }

    return result;
  }