Package org.jsoup.nodes

Examples of org.jsoup.nodes.Element


    }
  }

  private String extractEventGroup(Element eventDiv) {
    try {
      Element catH2 = eventDiv.previousElementSibling();
      while (!catH2.tagName().toLowerCase().equals("h2")) {
        catH2 = catH2.previousElementSibling();
      }
      Element catA = catH2.select("a").get(0);
      String text = catA.text();
      if (StringUtils.isNotBlank(text)) {
        return text.trim();
      } else {
        return null;
      }
View Full Code Here


    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();
      if (StringUtils.isNotBlank(eventUri)) {
        eventUri = eventUri.trim();
      } else {
View Full Code Here

       
        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

       
        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

                "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

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

        Document doc = Jsoup.parse(content, "UTF-8");
        Element anchorElement = doc.select("a[class=anchor]").first();

        assertThat(anchorElement.attr("href"), is("#_section_a"));

    }
View Full Code Here

        Options options = options().attributes(attributes).get();
       
        String renderContent = asciidoctor.render(":foo:\n\n{set:foo!}\n{foo}yes", options);

        Document doc = Jsoup.parse(renderContent, "UTF-8");
        Element paragraph = doc.getElementsByTag("p").first();
        assertThat(paragraph.text(), is("{foo}yes"));
    }
View Full Code Here

TOP

Related Classes of org.jsoup.nodes.Element

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.