Java XML Attribute Create writeAttribute(XMLStreamWriter xmlw, String name, String value)

Here you can find the source of writeAttribute(XMLStreamWriter xmlw, String name, String value)

Description

write Attribute

License

Apache License

Declaration

private static void writeAttribute(XMLStreamWriter xmlw, String name,
            String value) throws XMLStreamException 

Method Source Code

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

import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;

public class Main {
    private static void writeAttribute(XMLStreamWriter xmlw, String name,
            String value) throws XMLStreamException {
        if (!StringUtilisEmpty(value)) {
            xmlw.writeAttribute(name, value);
        }/*w w  w.  ja va  2  s  .  c  om*/
    }

    private static boolean StringUtilisEmpty(String str) {
        if (str == null || str.trim().equals("")) {
            return true;
        }
        return false;
    }
}

Related

  1. createFillAttributeGraphics(Document d, boolean showColor, boolean showGradientColor, boolean showGradientRotation, boolean showImage)
  2. createFontAttributeGraphics(Document d, boolean showFamily, boolean showStyle, boolean showWeight, boolean showSize, boolean showDecoration, boolean showAlign, boolean showRotation)
  3. mapifyAttrs(Node node, Map overwrite)
  4. writeAttribute(PrintWriter w, Attr attr, int depth)
  5. writeAttribute(XMLStreamWriter writer, String name, Object value)
  6. writeAttributeEvent(XMLEvent event, XMLStreamWriter writer)
  7. writeAttributes(Node node, Writer out)
  8. writeBoolAttr(Element element, String attributeName, boolean value)
  9. writeOutAttributesForNode(String[][] attributes, Node node)