Here you can find the source of printAttributesCompact(NamedNodeMap attributes, String indent, boolean descend)
private static void printAttributesCompact(NamedNodeMap attributes, String indent, boolean descend)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; public class Main { private static void printAttributesCompact(NamedNodeMap attributes, String indent, boolean descend) { System.out.println(indent + "Attributes: " + getAttributesCompact(attributes)); }//w ww . j av a2s . c o m 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 += ", "; } s += "]"; return s; } }