Package org.jsoup.nodes

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


        Document doc = page.getRenderedDocument();
        response.setContentType(getContentType(doc));

        // 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


    Element sourceElement = doc.select(elementSelector).first();
    if(sourceElement == null)
      sourceElement = doc.select("#pageContent").first();

    if(sourceElement == null)
      sourceElement = doc.body();

    if(sourceElement != null)
    { 
      Elements links = sourceElement.select("a[href]");
      Elements forms = sourceElement.select("form");
View Full Code Here

 
          return sourceElement.html();
    }
    else
    {
      return doc.body().html();
    }
  }
 
  public void setMethod(String method)
  {
View Full Code Here

                child.remove();
                wrappingNode.appendChild(child);
            }
        }

        Element body = embedDoc.body();
        Elements bodyChildren = body.children();
        ElementUtil.appendNodes(wrappingNode, new ArrayList<Node>(bodyChildren));

        // copy all the attrs to the wrapping group node
        Iterator<Attribute> attrs = elem.attributes().iterator();
View Full Code Here

    private Element renderedElement;

    public Component(Element elem, AttributesRequire attrs) throws Exception {
        Document doc = new Document("");
        doc.appendElement("body");
        doc.body().appendChild(elem);
        renderedElement = renderTemplate(doc, attrs);
    }

    public Component(Element elem) throws Exception {
        this(elem, null);
View Full Code Here

                child.remove();
                wrappingNode.appendChild(child);
            }
        }

        Element body = embedDoc.body();
        Elements bodyChildren = body.children();
        ElementUtil.appendNodes(wrappingNode, new ArrayList<Node>(bodyChildren));

        // copy all the attrs to the wrapping group node
        Iterator<Attribute> attrs = elem.attributes().iterator();
View Full Code Here

    Document document = Document.createShell( "" );

    // add the fragment's nodes to the body of resulting document
    Iterator<Element> nodes = fragment.children().iterator();
    while ( nodes.hasNext() ) {
      document.body().appendChild( nodes.next() );
    }

    return document;
  }
}
View Full Code Here

  private String getVersion(){
    String version = null;
    String url = Util.getWebsiteURL();
    try{
      Document doc = Jsoup.connect(url).get();
      Elements el = doc.body().select("li");
      version = parseVersion(el);
    }catch(IOException e){
      BufferedReader br = null;
      try {
        br = new BufferedReader(new FileReader("CHANGELOG"));
View Full Code Here

  private String getReleases(){
    String releases  = "";
    String url = Util.getWebsiteURL();
    try{
      Document doc = Jsoup.connect(url).get();
      releases = parseReleases(doc.body().select("li").select("ul"));
    }catch(IOException e){
      releases = "connection error";
    }
    return releases;
  }
View Full Code Here

            Document document = Document.createShell("");
            BootstrapPageResponse pageResponse = new BootstrapPageResponse(
                    this, request, context.getSession(), context.getUIClass(),
                    document, headers, fragmentResponse.getUIProvider());
            List<Node> fragmentNodes = fragmentResponse.getFragmentNodes();
            Element body = document.body();
            for (Node node : fragmentNodes) {
                body.appendChild(node);
            }

            setupStandaloneDocument(context, pageResponse);
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.