Examples of outerHtml()


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

        // TODO we should try to retrieve the content type
        if (currentRule.hasAttribute(AttrBodyOnly)) {
            response.getOutputStream().write(doc.body().html().getBytes("UTF-8"));
        } else {
            response.getOutputStream().write(doc.outerHtml().getBytes("UTF-8"));
        }

    }

}
View Full Code Here

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

        // TODO we should try to retrieve the content type
        if (currentRule.hasAttribute(AttrBodyOnly)) {
            response.getOutputStream().write(doc.body().html().getBytes("UTF-8"));
        } else {
            response.getOutputStream().write(doc.outerHtml().getBytes("UTF-8"));
        }
    }

}
View Full Code Here

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

            setupStandaloneDocument(context, pageResponse);
            context.getSession().modifyBootstrapResponse(pageResponse);

            sendBootstrapHeaders(response, headers);

            return document.outerHtml();
        } else {
            StringBuilder sb = new StringBuilder();
            for (Node node : fragmentResponse.getFragmentNodes()) {
                if (sb.length() != 0) {
                    sb.append('\n');
View Full Code Here

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

        // TODO we should try to retrieve the content type
        if (currentRule.hasAttribute(AttrBodyOnly)) {
            response.getOutputStream().write(doc.body().html().getBytes("UTF-8"));
        } else {
            response.getOutputStream().write(doc.outerHtml().getBytes("UTF-8"));
        }
    }

}
View Full Code Here

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

            setupStandaloneDocument(context, pageResponse);
            context.getSession().modifyBootstrapResponse(pageResponse);

            sendBootstrapHeaders(response, headers);

            return document.outerHtml();
        } else {
            StringBuilder sb = new StringBuilder();
            for (Node node : fragmentResponse.getFragmentNodes()) {
                if (sb.length() != 0) {
                    sb.append('\n');
View Full Code Here

Examples of org.jsoup.nodes.Element.outerHtml()

            String name = element.attr("id");

            StringBuilder description = new StringBuilder();
            Element descriptionPart = element.parent();
            do {
                description.append(descriptionPart.outerHtml());
            } while ((descriptionPart = descriptionPart.nextElementSibling()) != null && !descriptionPart.tagName().equals("h2"));

            File docFile = new File(outputDirectory, name + ".html");
            if (!docFile.exists()) {
                FileUtils.writeStringToFile(docFile, description + "<br><i>Module: " + moduleFile.getName() + "</i>");
View Full Code Here

Examples of org.jsoup.nodes.Element.outerHtml()

        td.html()), m_ow, false);
    Element movieElem = elems.get(0);
    String sOnClick = movieElem.attr("onclick");
    if (sOnClick.length() == 0)
      throw new DownloadFailedException(PbnTools.getStr("error.noAttr",
        "onclick", movieElem.outerHtml()), m_ow, false);
    Matcher m = Pattern.compile("^.*lin\\('(.*)'\\);.*$").matcher(sOnClick);
    if (!m.matches())
      throw new DownloadFailedException(PbnTools.getStr("error.onClickNotRec",
        sOnClick), m_ow, false);
    String sLin = f.decodeUrl(m.group(1));
View Full Code Here

Examples of org.jsoup.nodes.Element.outerHtml()

    if (iStart < 0) { throw new RuntimeException("tag " + e1.outerHtml() +
                         " not contained in html: " + sPar); }
    iStart += e1.outerHtml().length();
    int iEnd = -1;
    if (e2 != null) {
      iEnd = sPar.indexOf(e2.outerHtml(), iStart);
    }
    if (iEnd < 0) { iEnd = sPar.length(); }
    return htmlToText(sPar.substring(iStart, iEnd));
  }
 
View Full Code Here

Examples of org.jsoup.nodes.Element.outerHtml()

      this.parserHandler.foundComment(node.outerHtml());
    } else if (node instanceof Element) {
      Element enode = (Element) node;
      String tagname = enode.tagName();
      String text = cleanOutControlChars(enode.text());
      String outerHTML = cleanOutControlChars(enode.outerHtml());
      String innerHTML = cleanOutControlChars(enode.html());
      Attributes attrs = enode.attributes();
      Map<String, String> attributeMap = new HashMap<String, String>();
      for (Attribute attr : attrs) {
        attributeMap.put(attr.getKey(), attr.getValue());
View Full Code Here

Examples of org.jsoup.nodes.Element.outerHtml()

  String getJsoupElement(Document jsoupDoc, Map<String, String> jSoupConfig) {
    String selector = jSoupConfig.get("selector");
    if(jsoupDoc.select(selector).size() > 0) {
      Element element = jsoupDoc.select(selector).first();
      if (returnHTML) {
        return element.outerHtml().replaceAll(HTML_OUTPUT_CLEANUP, "");
      } else {
        return element.text();
      }
    }
    else {
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.