List of utility methods to do XML Attribute Append
void | appendAllAttributes(Node node, StringBuffer xpath) append All Attributes NamedNodeMap attr = node.getAttributes(); int len = attr.getLength(); if (len > 0) { for (int i = 0; i < len; i++) { Node item = attr.item(i); xpath.append("[@"); xpath.append(item.getNodeName()); xpath.append("='"); ... |
void | appendAttribute(Node node, String name, String value) Append the specified key/value pair of attributes to the Node .
Node attribute = node.getOwnerDocument().createAttribute(name); attribute.setNodeValue(value); node.getAttributes().setNamedItem(attribute); |
void | appendAttributeIfNotNull(Element parentElement, String attributeName, Object attributeValue) append Attribute If Not Null if (attributeValue != null) {
parentElement.setAttribute(attributeName, attributeValue.toString());
|
void | appendAttributeNode(String namespace, Element parent, String name, String value) append Attribute Node parent.setAttributeNS(namespace, name, value); |
void | appendAttributes(Node node, StringBuffer sb) append Attributes if (node instanceof Element) { NamedNodeMap nodeMap = node.getAttributes(); for (int i = 0; i < nodeMap.getLength(); i++) { sb.append(' '); sb.append(nodeMap.item(i).getNodeName()); sb.append('='); sb.append('"'); sb.append(nodeMap.item(i).getNodeValue()); ... |
void | appendBooleanAttribute(Element thisElement, String attrName, boolean value) append Boolean Attribute appendStringAttribute(thisElement, attrName, String.valueOf(value)); |
void | appendBooleanElement(Element parentElement, String nodeName, boolean value) append Boolean Element appendStringElement(parentElement, nodeName, String.valueOf(value)); |