Java XML Attribute Load getAllAttributes(Node node)

Here you can find the source of getAllAttributes(Node node)

Description

get All Attributes

License

Open Source License

Declaration

public static HashMap<String, String> getAllAttributes(Node node) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.HashMap;

import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;

public class Main {
    public static HashMap<String, String> getAllAttributes(Node node) {
        HashMap<String, String> attributes = new HashMap<String, String>();
        NamedNodeMap attr = node.getAttributes();
        for (int j = 0; j < attr.getLength(); j++) {
            attributes.put(attr.item(j).getNodeName(), attr.item(j).getNodeValue());
        }/*w w w .j  av a2  s .co  m*/
        return attributes;
    }
}

Related

  1. getAllAttributes(Element e)
  2. getAllAttributes(Element elem, String name)
  3. getAllAttributes(Element element)
  4. getAllAttributes(Node node)
  5. getAllAttributesAsMap(@Nullable final Element aSrcNode)
  6. getAllAttrs(Element parent, String name, List lst)
  7. getAllAttrValueByName(Node item, String name)