Java HTML Jsoup Element findRootElement(Element element)

Here you can find the source of findRootElement(Element element)

Description

find Root Element

License

Open Source License

Declaration

private static Element findRootElement(Element element) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import org.jsoup.nodes.Element;

public class Main {
    private static Element findRootElement(Element element) {
        Element parent;//  w  w  w  .  j  a va  2 s.  co  m
        do {
            parent = element.parent();
            if (parent == null) {
                return element;
            }
            element = parent;
        } while (parent != null);
        return null;
    }
}

Related

  1. findElementsByTag(Element element, String... tags)
  2. findFirstByTag(Element element, String tag)
  3. findNextElementSibling(final Element startElement, final Predicate condition)
  4. findPreviousH2Element(Element h3)
  5. findPreviousHElement(Elements sequence, Element reference)
  6. firstElement(final Element element, final String... tags)
  7. getActiveJob(Element element)
  8. getAllNodes(Element element)
  9. getAuthorName(Element authorElement)