@Test public void attributeMapwithNS() { Element e = doc.createElement(FOO); e.setAttributeNS(SOME_URI, FOO, BAR); Map<QName, String> m = Nodes.getAttributes(e); assertEquals(1, m.size()); assertEquals(BAR, m.get(new QName(SOME_URI, FOO))); assertEquals(BAR, m.get(new QName(SOME_URI, FOO, BAR))); }
public static Map<QName, String> getAttributes(Node n) { Map<QName, String> map = new LinkedHashMap<QName, String>(); NamedNodeMap m = n.getAttributes(); if (m != null) { final int len = m.getLength(); for (int i = 0; i < len; i++) { Attr a = (Attr) m.item(i); map.put(getQName(a), a.getValue()); } } return map; }
Nodes { public static Map<QName, String> getAttributes(Node n) { Map<QName, String> map = new LinkedHashMap<QName, String>(); NamedNodeMap m = n.getAttributes(); if (m != null) { final int len = m.getLength(); for (int i = 0; i < len; i++) { Attr a = (Attr) m.item(i); map.put(getQName(a), a.getValue()); } } return map; } }
Nodes { public static Map<QName, String> getAttributes(Node n) { Map<QName, String> map = new LinkedHashMap<QName, String>(); NamedNodeMap m = n.getAttributes(); if (m != null) { final int len = m.getLength(); for (int i = 0; i < len; i++) { Attr a = (Attr) m.item(i); map.put(getQName(a), a.getValue()); } } return map; } private  Nodes(); }
Nodes { public static Map<QName, String> getAttributes(Node n) { Map<QName, String> map = new LinkedHashMap<QName, String>(); NamedNodeMap m = n.getAttributes(); if (m != null) { final int len = m.getLength(); for (int i = 0; i < len; i++) { Attr a = (Attr) m.item(i); map.put(getQName(a), a.getValue()); } } return map; } private  Nodes(); static QName getQName(Node n); static String getMergedNestedText(Node n); static Map<QName, String> getAttributes(Node n); static Node stripWhitespace(Node original); static Node normalizeWhitespace(Node original); static Node stripElementContentWhitespace(Node original); }
Nodes { public static Map<QName, String> getAttributes(Node n) { Map<QName, String> map = new LinkedHashMap<QName, String>(); NamedNodeMap m = n.getAttributes(); if (m != null) { final int len = m.getLength(); for (int i = 0; i < len; i++) { Attr a = (Attr) m.item(i); map.put(getQName(a), a.getValue()); } } return map; } private  Nodes(); static QName getQName(Node n); static String getMergedNestedText(Node n); static Map<QName, String> getAttributes(Node n); static Node stripWhitespace(Node original); static Node normalizeWhitespace(Node original); static Node stripElementContentWhitespace(Node original);  }