Package org.jsoup.nodes

Examples of org.jsoup.nodes.Document


    Date markDate = markDateConfig.getDate();
    Date maxUpdateDate = markDate;

    StringBuilder log = new StringBuilder();
    String url = "http://spdwldr00.appspot.com/event/list?f=" + filterFmt.format(markDate);
    Document doc = null;
    try {
      doc = Jsoup.connect(url).get();
    } catch (IOException e) {
      log.append("[ERROR]: unable to connect to: ").append(url).append(": ")
          .append(e.getMessage()).append("\n");
      return log.toString();
    }

    int persisted = 0;
    int merged = 0;
    int skipped = 0;
    int errors = 0;
    BaseDao<IntEvent> dao = daoResolver.resolve(IntEvent.class);
    Elements trs = doc.select("tbody tr");
    for (int i = 0; i < 1; i++) {
      Element tr = trs.get(i);
      Elements tds = tr.select("td");

      String eventUri = tds.get(6).text();
View Full Code Here


    public void document_should_be_rendered_using_given_template_dir() {
       
        Options options = options().templateDir(new File("target/test-classes/src/custom-backends/haml/html5-tweaks")).toFile(false).get();
        String renderContent = asciidoctor.renderFile(new File("target/test-classes/rendersample.asciidoc"), options);
       
        Document doc = Jsoup.parse(renderContent, "UTF-8");
        Element paragraph = doc.select("div.content").first();
        assertThat(paragraph, notNullValue());
    }
View Full Code Here

       
        Attributes attributes = attributes().hiddenUriScheme(true).get();
       
        String content = asciidoctor.render("The AsciiDoc project is located at http://asciidoc.org.", OptionsBuilder.options().attributes(attributes));

        Document doc = Jsoup.parse(content, "UTF-8");
       
        Element link = doc.getElementsByTag("a").first();
        assertThat(link.text(), is("asciidoc.org"));
       
    }
View Full Code Here

       
        Attributes attributes = attributes().attribute("version", "1.0.0").compatMode(CompatMode.LEGACY).get();
       
        String content = asciidoctor.render("The `AsciiDoc {version}` project.", OptionsBuilder.options().attributes(attributes));

        Document doc = Jsoup.parse(content, "UTF-8");
        Element code = doc.getElementsByTag("code").first();
        assertThat(code.text(), containsString("{version}"));
       
    }
View Full Code Here

       
        Attributes attributes = attributes().attribute("version", "1.0.0").get();
       
        String content = asciidoctor.render("The `AsciiDoc {version}` project.", OptionsBuilder.options().attributes(attributes));

        Document doc = Jsoup.parse(content, "UTF-8");
        Element code = doc.getElementsByTag("code").first();
        assertThat(code.text(), containsString("1.0.0"));
       
    }
View Full Code Here

                .toDir(testFolder.getRoot()).attributes(attributes).get();

        asciidoctor.renderFile(new File(
                "target/test-classes/math.asciidoc"), options);

        Document doc = Jsoup.parse(new File(testFolder.getRoot(),
                "math.html"), "UTF-8");
       
        assertThat(doc.getElementsByAttributeValue("type", "text/x-mathjax-config").size(), is(1));
    }
View Full Code Here

                .toDir(testFolder.getRoot()).attributes(attributes).get();

        asciidoctor.renderFile(new File(
                "target/test-classes/appendix.asciidoc"), options);

        Document doc = Jsoup.parse(new File(testFolder.getRoot(),
                "appendix.html"), "UTF-8");
       
        Element attributeElement = doc.getElementById("_attribute_options");
        assertThat(attributeElement.text(), startsWith("App"));
    }
View Full Code Here

       
        Attributes attributes = attributes().hardbreaks(true).get();
       
        String content = asciidoctor.render("read\nmy\nlips", OptionsBuilder.options().attributes(attributes));

        Document doc = Jsoup.parse(content, "UTF-8");
        Element paragraph = doc.getElementsByAttributeValue("class","paragraph").first();
        assertThat(paragraph.getElementsByTag("br").size(), is(2));
       
    }
View Full Code Here

                .toDir(testFolder.getRoot()).attributes(attributes).get();

        asciidoctor.renderFile(new File(
                "target/test-classes/multiple_levels.asciidoc"), options);

        Document doc = Jsoup.parse(new File(testFolder.getRoot(),
                "multiple_levels.html"), "UTF-8");
       
        assertThat(doc.getElementById("_level_1").text(), startsWith("1."));
        assertThat(doc.getElementById("_level_2").text(), startsWith("1.1."));
        assertThat(doc.getElementById("_level_3").text(), not(startsWith("1.1.1.")));
        assertThat(doc.getElementById("_level_4").text(), not(startsWith("1.1.1.1.")));
    }
View Full Code Here

                .toDir(testFolder.getRoot()).attributes(attributes).get();

        asciidoctor.renderFile(new File(
                "target/test-classes/rendersample.asciidoc"), options);

        Document doc = Jsoup.parse(new File(testFolder.getRoot(),
                "rendersample.html"), "UTF-8");
       
        assertThat(doc.getElementById("footer"), is(nullValue()));
       
    }
View Full Code Here

TOP

Related Classes of org.jsoup.nodes.Document

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.