Package org.jsoup.nodes

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


            Element parent = element.parent();
            while (parent != root) {
                if (evaluator.matches(root, parent))
                    return true;
                parent = parent.parent();
            }
            return false;
        }

        public String toString() {
View Full Code Here


    Element firstHeading = findFirstElement(Selector.TOP_LEVEL_HEADINGS);
    if (firstHeading == null)
      return;
    int firstHeadingIndex = firstHeading.siblingIndex();
    List<Node> topNavigationEtc = new ArrayList<>();
    for (Node node : firstHeading.parent().childNodes()) {
      if (node.siblingIndex() < firstHeadingIndex)
        topNavigationEtc.add(node);
    }
    deleteNodes(topNavigationEtc);
  }
View Full Code Here

            Element parent = element.parent();
            while (parent != root) {
                if (evaluator.matches(root, parent))
                    return true;
                parent = parent.parent();
            }
            return false;
        }

        @Override
View Full Code Here

        while (value == null && elem != null) {
            // for a faked snippet node, we will just jump over it
            if (elem.tagName().equals(ExtNodeConstants.SNIPPET_NODE_TAG)) {
                String type = elem.attr(ExtNodeConstants.SNIPPET_NODE_ATTR_TYPE);
                if (type.equals(ExtNodeConstants.SNIPPET_NODE_ATTR_TYPE_FAKE)) {
                    elem = elem.parent();
                    continue;
                }
            }
            if (elem.hasAttr(dataRef)) {
                String id = elem.attr(dataRef);
View Full Code Here

                String id = elem.attr(dataRef);
                value = getData(SCOPE_EXT_ATTR, id);
            } else if (elem.hasAttr(key)) {
                value = elem.attr(key);
            }
            elem = elem.parent();
        }
        return value;
    }

    protected final ContextMap acquireMapForScope(String scope) {
View Full Code Here

            while (searchElem != null) {
                if (searchElem.tagName().equals(ExtNodeConstants.SNIPPET_NODE_TAG)) {
                    blockingParentId = searchElem.attr(ExtNodeConstants.ATTR_SNIPPET_REF);
                    break;
                } else {
                    searchElem = searchElem.parent();
                }
            }
            elem.attr(ExtNodeConstants.SNIPPET_NODE_ATTR_BLOCK, blockingParentId);
            // TODO should we replace the blocked element to a dummy place
            // holder element to avoid being rendered by parent snippets
View Full Code Here

    void insertInFosterParent(Node in) {
        Element fosterParent = null;
        Element lastTable = getFromStack("table");
        boolean isLastTableParent = false;
        if (lastTable != null) {
            if (lastTable.parent() != null) {
                fosterParent = lastTable.parent();
                isLastTableParent = true;
            } else
                fosterParent = aboveOnStack(lastTable);
        } else { // no table == frag
View Full Code Here

        Element fosterParent = null;
        Element lastTable = getFromStack("table");
        boolean isLastTableParent = false;
        if (lastTable != null) {
            if (lastTable.parent() != null) {
                fosterParent = lastTable.parent();
                isLastTableParent = true;
            } else
                fosterParent = aboveOnStack(lastTable);
        } else { // no table == frag
            fosterParent = stack.get(0);
View Full Code Here

        while (value == null && elem != null) {
            // for a faked snippet node, we will just jump over it
            if (elem.tagName().equals(ExtNodeConstants.SNIPPET_NODE_TAG)) {
                String type = elem.attr(ExtNodeConstants.SNIPPET_NODE_ATTR_TYPE);
                if (type.equals(ExtNodeConstants.SNIPPET_NODE_ATTR_TYPE_FAKE)) {
                    elem = elem.parent();
                    continue;
                }
            }
            if (elem.hasAttr(dataRef)) {
                String id = elem.attr(dataRef);
View Full Code Here

                String id = elem.attr(dataRef);
                value = getData(SCOPE_EXT_ATTR, id);
            } else if (elem.hasAttr(key)) {
                value = elem.attr(key);
            }
            elem = elem.parent();
        }
        return value;
    }

    protected final ContextMap acquireMapForScope(String scope) {
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.