Package org.jsoup.nodes

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


        // .attr("frameBorder", "0");

        final Element helpDiv = doc.body().appendElement("div").attr("id", "helpframe")
            .attr("style", "display: none;");
        for (final Node n : Help.getHelpDoc().body().childNodes()) {
          helpDiv.appendChild(n.clone());
        }

        int lineNo = 1;
        final SequentialParser sp = SequentialParser.create();
                Element worksheetElement = doc.body().select("#worksheet").first();
View Full Code Here


    }

    public final static Element text(String text) {
        TextNode node = new TextNode(text, "");
        Element wrap = new GroupNode();
        wrap.appendChild(node);
        return wrap;
    }

    public final static Elements parse(String html) {
        return Jsoup.parseBodyFragment(html).select("body");
View Full Code Here

    public final static Element wrapElementsToSingleNode(List<Node> elements) {
        Element groupNode = new GroupNode();
        List<Node> list = new ArrayList<Node>(elements);
        for (Node node : list) {
            node.remove();
            groupNode.appendChild(node);
        }
        return groupNode;
    }

    /**
 
View Full Code Here

        Element grp = new GroupNode();
        List<Node> children = new ArrayList<>(doc.body().childNodes());
        for (Node node : children) {
            node.remove();
            grp.appendChild(node);
        }

        return grp;
    }
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

        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

                    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 grp = new GroupNode();
        List<Node> children = new ArrayList<>(doc.body().childNodes());
        for (Node node : children) {
            node.remove();
            grp.appendChild(node);
        }

        return grp;
    }
View Full Code Here

    }

    public final static Element text(String text) {
        TextNode node = new TextNode(text, "");
        Element wrap = new GroupNode();
        wrap.appendChild(node);
        return wrap;
    }

    /**
     * parse given html source to a single Element
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.