Package org.jsoup.nodes

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


            trHeight = Integer.parseInt(trHeightS);
          }catch(NumberFormatException e){
            e.printStackTrace();
          }
        }
        Elements tds = tr.children();
        int tdHeight = -1;
        for(int tdi=0;tdi<tds.size();tdi++){
          Element td = tds.get(tdi);
          if(td.hasAttr("height")){
            String tdHeightS = td.attr("height");
View Full Code Here


     */
    public static final class IsLastChild extends Evaluator {
    @Override
    public boolean matches(Element root, Element element) {
      final Element p = element.parent();
      return p != null && !(p instanceof Document) && element.elementSiblingIndex() == p.children().size()-1;
    }
     
    @Override
    public String toString() {
      return ":last-child";
View Full Code Here

    public boolean matches(Element root, Element element) {
      final Element p = element.parent();
      if (p==null || p instanceof Document) return false;
     
      int pos = 0;
          Elements family = p.children();
          for (int i = 0; i < family.size(); i++) {
            if (family.get(i).tag().equals(element.tag())) pos++;
          }
          return pos == 1;
    }
View Full Code Here

                Element wrappingNode = ElementUtil.wrapElementsToSingleNode(children);
        */
        Element wrappingNode = new GroupNode();
        // retrieve all the blocks that misincluded into head
        Element head = embedDoc.head();
        Elements headChildren = head.children();
        List<Node> tempList = new ArrayList<>();
        String tagName;
        for (Element child : headChildren) {
            if (StringUtil.in(child.tagName(), "script", "link", ExtNodeConstants.BLOCK_NODE_TAG)) {
                child.remove();
View Full Code Here

                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();
        Attribute attr;
View Full Code Here

                Element wrappingNode = ElementUtil.wrapElementsToSingleNode(children);
        */
        Element wrappingNode = new GroupNode();
        // retrieve all the blocks that misincluded into head
        Element head = embedDoc.head();
        Elements headChildren = head.children();
        List<Node> tempList = new ArrayList<>();
        String tagName;
        for (Element child : headChildren) {
            if (StringUtil.in(child.tagName(), "script", "link", ExtNodeConstants.BLOCK_NODE_TAG)) {
                child.remove();
View Full Code Here

                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();
        Attribute attr;
View Full Code Here

    public boolean matches(Element root, Element element) {
      final Element p = element.parent();
      if (p==null || p instanceof Document) return false;
     
      int pos = 0;
          Elements family = p.children();
          for (int i = 0; i < family.size(); i++) {
            if (family.get(i).tag().equals(element.tag())) pos++;
          }
          return pos == 1;
    }
View Full Code Here

     */
    public static final class IsLastChild extends Evaluator {
    @Override
    public boolean matches(Element root, Element element) {
      final Element p = element.parent();
      return p != null && !(p instanceof Document) && element.elementSiblingIndex() == p.children().size()-1;
    }
     
    @Override
    public String toString() {
      return ":last-child";
View Full Code Here

     */
    public static final class IsLastChild extends Evaluator {
    @Override
    public boolean matches(Element root, Element element) {
      final Element p = element.parent();
      return p != null && !(p instanceof Document) && element.elementSiblingIndex() == p.children().size()-1;
    }
     
    @Override
    public String toString() {
      return ":last-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.