Here you can find the source of getAllAttributes(Node node)
public static HashMap<String, String> getAllAttributes(Node node)
//package com.java2s; //License from project: Open Source License import java.util.HashMap; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; public class Main { public static HashMap<String, String> getAllAttributes(Node node) { HashMap<String, String> attributes = new HashMap<String, String>(); NamedNodeMap attr = node.getAttributes(); for (int j = 0; j < attr.getLength(); j++) { attributes.put(attr.item(j).getNodeName(), attr.item(j).getNodeValue()); }/*w w w .j av a2 s .co m*/ return attributes; } }