예제 #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;
  }