Java XML Attribute Create createAttribute(Document document, String name, String value)

Here you can find the source of createAttribute(Document document, String name, String value)

Description

create Attribute

License

LGPL

Declaration

public static Attr createAttribute(Document document, String name, String value) 

Method Source Code

//package com.java2s;
/*//w ww .ja va2  s  . c o  m
 * JFox - The most lightweight Java EE Application Server!
 * more details please visit http://www.huihoo.org/jfox or http://www.jfox.org.cn.
 *
 * JFox is licenced and re-distributable under GNU LGPL.
 */

import org.w3c.dom.Attr;

import org.w3c.dom.Document;

public class Main {

    public static Attr createAttribute(Document document, String name, String value) {
        Attr attr = document.createAttribute(name);
        attr.setTextContent(value);
        return attr;
    }
}

Related

  1. createAttr(Element parent, String name, Object value)
  2. createAttr(String attrName, String attrValue, Document document)
  3. createAttribute(Document doc, String friendlyName, String samlNS, String samlPrefix, QName attrKey)
  4. createAttribute(Document doc, String nodeName, Map map)
  5. createAttribute(String sName, String sValue, Node nParent)
  6. createAttributeTable(Element e)
  7. createFillAttributeGraphics(Document d, boolean showColor, boolean showGradientColor, boolean showGradientRotation, boolean showImage)
  8. createFontAttributeGraphics(Document d, boolean showFamily, boolean showStyle, boolean showWeight, boolean showSize, boolean showDecoration, boolean showAlign, boolean showRotation)