Examples of childNodes()


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

            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

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

            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

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

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

            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

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

            // chain)
        }

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

    @Override
View Full Code Here

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

            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

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

     * @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

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

        Node node = root;
        int depth = 0;
       
        while (node != null) {
            visitor.head(node, depth);
            if (node.childNodes().size() > 0) {
                node = node.childNode(0);
                depth++;
            } else {
                while (node.nextSibling() == null && depth > 0) {
                    visitor.tail(node, depth);
View Full Code Here

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

      Preconditions.checkNotNull(node);
   
      Node parent = node.parent();
      if (null == parent) return null;

      return parent.childNodes();              
  }

  protected static <N extends Node> Integer indexInList(N search, List<N> nodes) {
        Preconditions.checkNotNull(search);
        Preconditions.checkNotNull(nodes);
View Full Code Here

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

    List<Node> nodes = HtmlParser.parse("<html>" + requireString + "</html>");
    Node node = nodes.get(0).childNode(0);

    WidgetChain inner = Chains.terminal();
    if (!node.childNodes().isEmpty())
      inner = Chains.singleton(new TextWidget(node.childNode(0).toString(), compiler));

    chain.addWidget(new RequireWidget(new XmlWidget(inner, node.nodeName(), compiler,
        HtmlTemplateCompiler.parseAttribs(node.attributes()))));
    chain.addWidget(new RequireWidget(new XmlWidget(inner, node.nodeName(), compiler,
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.