Example usage for org.jsoup.nodes Attributes put

List of usage examples for org.jsoup.nodes Attributes put

Introduction

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

Prototype

public Attributes put(Attribute attribute) 

Source Link

Document

Set a new attribute, or replace an existing one by key.

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);
    }// w w w.  jav  a2  s .  co  m

    return dest;
}