Here you can find the source of getAttributesCompact(NamedNodeMap attributes)
private static String getAttributesCompact(NamedNodeMap attributes)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; public class Main { private static String getAttributesCompact(NamedNodeMap attributes) { String s = "["; for (int i = 0; i < attributes.getLength(); ++i) { Node n = attributes.item(i); s += n.getNodeName() + "=\"" + n.getNodeValue() + "\""; s += ", "; }/* w ww . j a v a 2s . co m*/ s += "]"; return s; } }