Here you can find the source of parseXml(final Node node, final Map
private static Map<QName, String> parseXml(final Node node, final Map<QName, String> properties)
//package com.java2s; //License from project: Open Source License import java.util.Map; import javax.xml.namespace.QName; import org.w3c.dom.Node; public class Main { private static Map<QName, String> parseXml(final Node node, final Map<QName, String> properties) { for (int i = 0; i < node.getAttributes().getLength(); i++) { final Node item = node.getAttributes().item(i); final QName itemType = (item.getNamespaceURI() == null) ? new QName(item.getNodeName()) : new QName(item.getNamespaceURI(), item.getLocalName()); properties.put(itemType, item.getNodeValue()); }/* w w w. j a va 2s .c om*/ for (int i = 0; i < node.getChildNodes().getLength(); i++) { final Node item = node.getChildNodes().item(i); final QName itemType = (item.getNamespaceURI() == null) ? new QName(item.getNodeName()) : new QName(item.getNamespaceURI(), item.getLocalName()); properties.put(itemType, item.getNodeValue()); } return properties; } }