Here you can find the source of parseWidget(NodeList widgetList)
public static Map parseWidget(NodeList widgetList)
//package com.java2s; import java.util.HashMap; import java.util.Map; import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class Main { public static Map parseWidget(NodeList widgetList) { Map map = new HashMap(); try {/*w ww . j a va 2 s.c om*/ for (int i = 0; i < widgetList.getLength(); i++) { Node widget = widgetList.item(i); if (widget.getNodeName().equals("widget")) { String id = widget.getAttributes().getNamedItem("id").getTextContent(); Map attrMap = parseAttribute(widget.getChildNodes()); map.put(id, attrMap); } } } catch (Exception e) { e.printStackTrace(); } return map; } public static Map parseAttribute(NodeList abtList) { Map map = new HashMap(); try { for (int i = 0; i < abtList.getLength(); i++) { Node abt = abtList.item(i); if (abt.getNodeType() == 1) { map.put(abt.getNodeName(), abt.getTextContent()); } } } catch (Exception e) { e.printStackTrace(); } return map; } }