Android XML Attribute Set setXmlAttributeValue(Document xml, Element elem, String name, String value)

Here you can find the source of setXmlAttributeValue(Document xml, Element elem, String name, String value)

Description

set Xml Attribute Value

Declaration

public static final void setXmlAttributeValue(Document xml,
            Element elem, String name, String value) 

Method Source Code

//package com.java2s;

import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;

public class Main {
    public static final void setXmlAttributeValue(Document xml,
            Element elem, String name, String value) {
        Attr a = xml.createAttribute(name);
        a.setValue(value);//from  w  w w. j  a  v a 2  s  .  co m
        elem.getAttributes().setNamedItem(a);
    }
}

Related

  1. clearAttributes(Attributes attributes, Map tagCache)
  2. addElementWithTagAttr(StringBuffer out, String tag, String content, String[] attr)