Package org.jsoup.nodes

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


                    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);
            context.getSession().modifyBootstrapResponse(pageResponse);
View Full Code Here


                        + bootstrapLocation) + ");\n");

        appendMainScriptTagContents(context, builder);

        builder.append("//]]>");
        mainScriptTag.appendChild(new DataNode(builder.toString(),
                mainScriptTag.baseUri()));
        fragmentNodes.add(mainScriptTag);

    }
View Full Code Here

          Element tr = trs.get(0);
          for(int i=0;i<count;i++){
            Element newTr = getDefaultTr();
            tr.before(newTr);
            for(int j=0;j<colNumber;j++){
              newTr.appendChild(getDefaultTd());
            }
          }
        }else{
          Element tr = trs.get(index);
          for(int i=0;i<count;i++){
View Full Code Here

          Element tr = trs.get(index);
          for(int i=0;i<count;i++){
            Element newTr = getDefaultTr();
            tr.before(newTr);
            for(int j=0;j<colNumber;j++){
              newTr.appendChild(getDefaultTd());
            }
          }
        }
      }else{
        Element tr = trs.last();
View Full Code Here

        Element tr = trs.last();
        for(int i=0;i<count;i++){
          Element newTr = getDefaultTr();
          tr.after(newTr);
          for(int j=0;j<colNumber;j++){
            newTr.appendChild(getDefaultTd());
          }
        }
      }
    }
  }
View Full Code Here

        Document doc = Document.createShell(baseUri);
        Element body = doc.body();
        List<Node> nodeList = parseFragment(bodyHtml, body, baseUri);
        Node[] nodes = nodeList.toArray(new Node[nodeList.size()]); // the node list gets modified when re-parented
        for (Node node : nodes) {
            body.appendChild(node);
        }
        return doc;
    }

    /**
 
View Full Code Here

    default: {
      // more than one element
      // wrap into <div> which we will remove afterwards
      Element root = new Element(Tag.valueOf("div"), "");
      for (Element elem : elements) {
        root.appendChild(elem);
      }

      return root.html();
    }
    }
View Full Code Here

    // otherwise there may be problems, e.g. with <body> element
    Element topDiv = new Element(Tag.valueOf("div"), "");
    for (Element topElem : element.children()) {
      // add all elements in the body to the `topDiv`
      topElem.remove();
      topDiv.appendChild(topElem);
    }

    // add topDiv to the body
    element.appendChild(topDiv);
View Full Code Here

        // remove row from its original position
        row.remove();
       
        // create table header element with the row
        Element thead = new Element(Tag.valueOf("thead"), "");
        thead.appendChild(row);
        // add at the beginning of the table
        table.prependChild(thead);
      }
     
      return body.html();
View Full Code Here


  private Element addChildToParent(Element child, boolean isEmptyElement) {
    Element parent = popStackToSuitableContainer(child.tag());
    if (parent != null)
      parent.appendChild(child);

    if (!isEmptyElement && !child.tag().isData()) {
      stack.addLast(child);
    }
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.