Java XML Attribute from Node parseAttributes(Node node)

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

Description

parse Attributes

License

Open Source License

Declaration

public static Properties parseAttributes(Node node) 

Method Source Code


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

import java.util.Properties;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;

public class Main {
    public static Properties parseAttributes(Node node) {
        Properties attributes = new Properties();
        NamedNodeMap attributeNodes = node.getAttributes();
        for (int i = 0; i < attributeNodes.getLength(); i++) {
            Node attribute = attributeNodes.item(i);
            attributes.put(attribute.getNodeName(), attribute.getNodeValue());
        }//from www .  j a  v  a  2s.  c o m
        return attributes;
    }
}

Related

  1. getYesNoAttrVal(final NamedNodeMap nnm, final String name)
  2. hasAttribByName(Element node, String name)
  3. parseAttribute(Node lnNode, String attributeName)
  4. parseAttribute(NodeList abtList)
  5. parseAttributes(Node n)
  6. parseAttributesTag(Node n)
  7. xmlGetAttribute(Node node, String attrname)
  8. xmlGetAttribute2(Node node, String attrname)