Here you can find the source of getAttributes(Element el)
Parameter | Description |
---|---|
el | - element |
public static Map<String, String> getAttributes(Element el)
//package com.java2s; //License from project: Open Source License import java.util.LinkedHashMap; import java.util.Map; import org.w3c.dom.Element; import org.w3c.dom.NamedNodeMap; public class Main { /**//from w w w.java 2 s .c o m * get attribute map from the element * @param el - element * @return mapping of attributes */ public static Map<String, String> getAttributes(Element el) { Map<String, String> list = new LinkedHashMap<String, String>(); NamedNodeMap map = el.getAttributes(); for (int i = 0; i < map.getLength(); i++) { list.put(map.item(i).getNodeName(), map.item(i).getNodeValue()); } return list; } }