Package org.jsoup.nodes

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


      return;
    }
    Element indexLink = findFirstElement(Selector.TOC_HEADING_2).clone();
    String fileExtension = ".htm";
    Node ankerNode = null;
    for (Node node : indexLink.childNodes()) {
      if (node.hasAttr("href")) {
        ankerNode = node.clone();
        if (ankerNode.attr("href").contains(".html"))
          fileExtension = ".html";
        break;
View Full Code Here


            if (targetBlock == null) {
                // TODO I want a approach to logging out template file path here
                logger.warn("The block declares a not existed target block.[{}]", block.toString());
                continue;
            }
            childNodes = new ArrayList<>(block.childNodes());
            ElementUtil.safeEmpty(block);
            switch (blockType) {
            case ExtNodeConstants.BLOCK_NODE_ATTR_OVERRIDE:
                targetBlock.empty();
                ElementUtil.appendNodes(targetBlock, childNodes);
View Full Code Here

            // chain)
        }

        runParser();
        if (context != null)
            return root.childNodes();
        else
            return doc.childNodes();
    }

    @Override
View Full Code Here

            if (targetBlock == null) {
                // TODO I want a approach to logging out template file path here
                logger.warn("The block declares a not existed target block.[{}]", block.toString());
                continue;
            }
            childNodes = new ArrayList<>(block.childNodes());
            ElementUtil.safeEmpty(block);
            switch (blockType) {
            case ExtNodeConstants.BLOCK_NODE_ATTR_OVERRIDE:
                targetBlock.empty();
                ElementUtil.appendNodes(targetBlock, childNodes);
View Full Code Here

     * @return a Element object which contains the dom tree created from passed
     *         html source
     */
    public final static Element parseAsSingle(String html) {
        Element body = Jsoup.parseBodyFragment(html).body();
        List<Node> children = body.childNodes();
        return wrapElementsToSingleNode(children);
    }

    public final static Element wrapElementsToSingleNode(List<Node> elements) {
        Element groupNode = new GroupNode();
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.