Here you can find the source of attributeMap(Element element)
public static Map<String, String> attributeMap(Element element)
//package com.java2s; /* //from w w w .j a v a2 s .c o m * This file is part of DISMOD Core. * ? Copyright 2003-2011 Fraunhofer Institut f. Materialfluss und Logistik. * http://www.iml.fraunhofer.de, http://www.verkehrslogistik.de * * DISMOD Core is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * DISMOD Core is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with DISMOD Core. If not, see <http://www.gnu.org/licenses/>. */ import java.util.HashMap; import java.util.Map; import org.w3c.dom.Attr; import org.w3c.dom.Element; import org.w3c.dom.NamedNodeMap; public class Main { public static Map<String, String> attributeMap(Element element) { NamedNodeMap n = element.getAttributes(); HashMap<String, String> map = new HashMap<String, String>(); for (int i = 0; i < n.getLength(); i++) { Attr a = (Attr) n.item(i); map.put(a.getName(), a.getValue()); } return map; } }