Package org.jsoup.nodes

Examples of org.jsoup.nodes.Document.head()


  }
 
  @Override
  protected void loadPage() throws Exception {
    Document jsoup = Jsoup.parse(getInputStream(), getContentEncoding(response), getUri());
    setBaseUri(jsoup.head().baseUri());
    this.htmlElements = new HtmlElements(this, jsoup);
  }

  private void setBaseUri(final String baseUri) {
    if (! this.getUri().equals(baseUri))
View Full Code Here


        DocumentType doctype = new DocumentType("html", "", "",
                document.baseUri());
        document.child(0).before(doctype);

        Element head = document.head();
        head.appendElement("meta").attr("http-equiv", "Content-Type")
                .attr("content", "text/html; charset=utf-8");

        /*
         * Enable Chrome Frame in all versions of IE if installed.
View Full Code Here

  }
 
  public static Workbook convertHTML2Excel(String tables){
    if(tables!=null){
      Document doc = Jsoup.parse(tables);
      doc.head().append("<META HTTP-EQUIV=\"CONTENT-TYPE\" CONTENT=\"text/html; charset=utf-8\">");
      try {
//        byte[] html = doc.toString().getBytes("utf-8");
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
//        DocumentConverter.convert(doc.toString().getBytes("utf-8"), "html", bos, "xls");
        Workbook wb = WorkbookFactory.create(new ByteArrayInputStream(bos.toByteArray()));
View Full Code Here

  }

    private Document createDocument(final URL requestURL, final Worksheet worksheet) {
        final Document doc = Document.createShell(requestURL.toString());
        doc.head().appendElement("title").text("LastCalc");
        doc.head().appendElement("link").attr("rel", "stylesheet").attr("href", "/css/highlighting.css")
        .attr("type", "text/css");
        doc.head().appendElement("link").attr("rel", "stylesheet").attr("href", "/css/locutus.css")
        .attr("type", "text/css");
        doc.head().appendElement("link").attr("rel", "stylesheet")
View Full Code Here

  }

    private Document createDocument(final URL requestURL, final Worksheet worksheet) {
        final Document doc = Document.createShell(requestURL.toString());
        doc.head().appendElement("title").text("LastCalc");
        doc.head().appendElement("link").attr("rel", "stylesheet").attr("href", "/css/highlighting.css")
        .attr("type", "text/css");
        doc.head().appendElement("link").attr("rel", "stylesheet").attr("href", "/css/locutus.css")
        .attr("type", "text/css");
        doc.head().appendElement("link").attr("rel", "stylesheet")
        .attr("href", "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.17/themes/base/jquery-ui.css")
View Full Code Here

    private Document createDocument(final URL requestURL, final Worksheet worksheet) {
        final Document doc = Document.createShell(requestURL.toString());
        doc.head().appendElement("title").text("LastCalc");
        doc.head().appendElement("link").attr("rel", "stylesheet").attr("href", "/css/highlighting.css")
        .attr("type", "text/css");
        doc.head().appendElement("link").attr("rel", "stylesheet").attr("href", "/css/locutus.css")
        .attr("type", "text/css");
        doc.head().appendElement("link").attr("rel", "stylesheet")
        .attr("href", "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.17/themes/base/jquery-ui.css")
        .attr("type", "text/css");
        doc.head().appendElement("script").attr("src", "/js/json2.js");
View Full Code Here

        doc.head().appendElement("title").text("LastCalc");
        doc.head().appendElement("link").attr("rel", "stylesheet").attr("href", "/css/highlighting.css")
        .attr("type", "text/css");
        doc.head().appendElement("link").attr("rel", "stylesheet").attr("href", "/css/locutus.css")
        .attr("type", "text/css");
        doc.head().appendElement("link").attr("rel", "stylesheet")
        .attr("href", "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.17/themes/base/jquery-ui.css")
        .attr("type", "text/css");
        doc.head().appendElement("script").attr("src", "/js/json2.js");
        doc.head().appendElement("script")
        .attr("src", "https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js");
View Full Code Here

        doc.head().appendElement("link").attr("rel", "stylesheet").attr("href", "/css/locutus.css")
        .attr("type", "text/css");
        doc.head().appendElement("link").attr("rel", "stylesheet")
        .attr("href", "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.17/themes/base/jquery-ui.css")
        .attr("type", "text/css");
        doc.head().appendElement("script").attr("src", "/js/json2.js");
        doc.head().appendElement("script")
        .attr("src", "https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js");
        // doc.head().appendElement("script").attr("src",
        // "/js/jquery.tools.min.js");
        doc.head().appendElement("script")
View Full Code Here

        .attr("type", "text/css");
        doc.head().appendElement("link").attr("rel", "stylesheet")
        .attr("href", "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.17/themes/base/jquery-ui.css")
        .attr("type", "text/css");
        doc.head().appendElement("script").attr("src", "/js/json2.js");
        doc.head().appendElement("script")
        .attr("src", "https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js");
        // doc.head().appendElement("script").attr("src",
        // "/js/jquery.tools.min.js");
        doc.head().appendElement("script")
        .attr("src", "https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.17/jquery-ui.min.js");
View Full Code Here

        doc.head().appendElement("script").attr("src", "/js/json2.js");
        doc.head().appendElement("script")
        .attr("src", "https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js");
        // doc.head().appendElement("script").attr("src",
        // "/js/jquery.tools.min.js");
        doc.head().appendElement("script")
        .attr("src", "https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.17/jquery-ui.min.js");
        doc.head().appendElement("script").attr("src", "/js/jquery.cookie.js");
        doc.head().appendElement("script").attr("src", "/js/rangy-core.js");
        doc.head().appendElement("script").attr("src", "/js/rangy-selectionsaverestore.js");
        doc.head().appendElement("script").attr("src", "/js/locutus.js");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.