Java HTML Jsoup Element createSafeElement(Element sourceEl)

Here you can find the source of createSafeElement(Element sourceEl)

Description

create Safe Element

License

Apache License

Declaration

private static Element createSafeElement(Element sourceEl) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import org.jsoup.nodes.*;
import org.jsoup.parser.Tag;

public class Main {

    private static Element createSafeElement(Element sourceEl) {
        String sourceTag = sourceEl.tagName();
        Attributes destAttrs = new Attributes();
        Element dest = new Element(Tag.valueOf(sourceTag), sourceEl.baseUri(), destAttrs);
        Attributes sourceAttrs = sourceEl.attributes();
        for (Attribute sourceAttr : sourceAttrs) {
            destAttrs.put(sourceAttr);/*ww  w  .  ja  v a  2  s. c  o m*/
        }
        return dest;
    }
}

Related

  1. convertLinksToStrings(Elements links)
  2. convertNodeToText(Element element)
  3. convertTablesToDivs(Element body)
  4. copy(Element e)
  5. countElements(Node parent)
  6. elementsToList(Elements elements)
  7. extractTextWithNewlines(Element elem)
  8. filterElementsByTag(List results, Element element, Set tagSet)
  9. findAElementsWithId(Elements elements, String id)