Example usage for org.jsoup.nodes Element Element

List of usage examples for org.jsoup.nodes Element Element

Introduction

In this page you can find the example usage for org.jsoup.nodes Element Element.

Prototype

public Element(Tag tag, String baseUri, Attributes attributes) 

Source Link

Document

Create a new, standalone Element.

Usage

From source file:no.kantega.publishing.admin.content.htmlfilter.RemoveNestedSpanTagsFilter.java

private static Element createSafeElement(Element sourceEl) {
    String sourceTag = sourceEl.tagName();
    org.jsoup.nodes.Attributes destAttrs = new org.jsoup.nodes.Attributes();
    Element dest = new Element(Tag.valueOf(sourceTag), sourceEl.baseUri(), destAttrs);

    org.jsoup.nodes.Attributes sourceAttrs = sourceEl.attributes();
    for (Attribute sourceAttr : sourceAttrs) {
        destAttrs.put(sourceAttr);//  ww w . j  a  va  2 s . c  o  m
    }

    return dest;
}