Here you can find the source of getAttributes(Node node)
public static Map<String, String> getAttributes(Node node)
//package com.java2s; //License from project: Open Source License import java.util.Map; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; import com.google.common.collect.Maps; public class Main { public static Map<String, String> getAttributes(Node node) { NamedNodeMap map = node.getAttributes(); Map<String, String> result = Maps.newHashMap(); if (map != null) { for (int i = 0; i < map.getLength(); i++) { result.put(map.item(i).getNodeName(), map.item(i).getNodeValue()); }// www .j av a 2 s . c om } return result; } }