Java XML Element Text Set setElementAttr(Element element, String attr, String attrVal)

Here you can find the source of setElementAttr(Element element, String attr, String attrVal)

Description

Set the value of attribute

License

Apache License

Parameter

Parameter Description
element a parameter
attr a parameter
attrVal a parameter

Declaration

public static void setElementAttr(Element element, String attr, String attrVal) 

Method Source Code

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

import org.w3c.dom.Element;

public class Main {
    /**/*  w w  w  .  j a v a  2  s . c  o m*/
     * Set the value of attribute
     *
     * @param element
     * @param attr
     * @param attrVal
     */
    public static void setElementAttr(Element element, String attr, String attrVal) {
        element.setAttribute(attr, attrVal);
    }
}

Related

  1. setElementContent(final Node n, final String s)
  2. setElementSimpleValue(Element element, String simpleValue)
  3. setElementsTextNodeValue(Node element, String value)
  4. setElementText(Element element, String text)