Java HTML Jsoup Element copy(Element e)

Here you can find the source of copy(Element e)

Description

copy

License

Open Source License

Declaration

public static Element copy(Element e) 

Method Source Code


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

import org.jsoup.nodes.Attribute;
import org.jsoup.nodes.Element;
import org.jsoup.parser.Tag;

public class Main {
    public static Element copy(Element e) {
        Element res = new Element(Tag.valueOf(e.tagName()), e.baseUri());
        for (Attribute a : e.attributes()) {
            res.attr(a.getKey(), a.getValue());
        }//w  ww.ja v  a2s .com
        res.html(e.html());
        return res;
    }
}

Related

  1. collectTextUntilNextTag(final Element header, final String nextTagName)
  2. containsLink(Element element, String link)
  3. convertLinksToStrings(Elements links)
  4. convertNodeToText(Element element)
  5. convertTablesToDivs(Element body)
  6. countElements(Node parent)
  7. createSafeElement(Element sourceEl)
  8. elementsToList(Elements elements)
  9. extractTextWithNewlines(Element elem)