public Map getAttributes()

in src/main/java/org/apache/neethi/builders/converters/AbstractStaxConverter.java [46:62]


    public Map<QName, String> getAttributes(XMLStreamReader s) {
        Map<QName, String> mp = new HashMap<QName, String>();
        for (int x = 0; x < s.getAttributeCount(); x++) {
            mp.put(new QName(s.getAttributeNamespace(x),
                             s.getAttributeLocalName(x)),
                   s.getAttributeValue(x));
        }
        for (int x = 0; x < s.getNamespaceCount(); x++) {
            String pfx = s.getNamespacePrefix(x);
            if (pfx == null) {
                mp.put(new QName(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, "xmlns"), s.getNamespaceURI(x));
            } else {
                mp.put(new QName(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, pfx, "xmlns"), s.getNamespaceURI(x));
            }
        }
        return mp;
    }