Here you can find the source of getAttributesValues(final StartElement element)
static Map<String, String> getAttributesValues(final StartElement element)
//package com.java2s; //License from project: Open Source License import javax.xml.stream.events.Attribute; import javax.xml.stream.events.StartElement; import java.util.HashMap; import java.util.Iterator; import java.util.Map; public class Main { static Map<String, String> getAttributesValues(final StartElement element) { final Map<String, String> values = new HashMap<>(4); @SuppressWarnings("unchecked") final Iterator<Attribute> attributes = element.getAttributes(); while (attributes.hasNext()) { final Attribute attr = attributes.next(); values.put(attr.getName().getLocalPart(), attr.getValue()); }/* ww w . j a v a 2 s.c o m*/ return values; } }