Java HTML Jsoup Element setAttribute(Element e, String key, String value)

Here you can find the source of setAttribute(Element e, String key, String value)

Description

Set an attribute on an element (in the data-baleen namespace)

License

Apache License

Parameter

Parameter Description
e a parameter
key a parameter
value a parameter

Declaration

public static void setAttribute(Element e, String key, String value) 

Method Source Code

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

import org.jsoup.nodes.Element;

public class Main {
    private static final String BALEEN_ATTRIBUTE_PREFIX = "data-baleen-";

    /**// w  w w. j a  v a  2s  .  c  o  m
     * Set an attribute on an element (in the data-baleen namespace)
     * 
     * @param e
     * @param key
     * @param value
     */
    public static void setAttribute(Element e, String key, String value) {
        e.attr(attributeKey(key), value);
    }

    private static String attributeKey(String key) {
        return BALEEN_ATTRIBUTE_PREFIX + key;
    }
}

Related

  1. printNode(Element root)
  2. processCheck(Element ele, Element parent, String dict)
  3. randomElement()
  4. replaceHtml(Node element)
  5. sameTagElNums(Element e)
  6. stripAttribute(Element body, String attribute)
  7. stripEmptyDivs(Element body)
  8. stripStyles(Element body)
  9. updateData(Element element, String data)