Java XML Attribute from Node parseAttribute(NodeList abtList)

Here you can find the source of parseAttribute(NodeList abtList)

Description

parse Attribute

License

Open Source License

Declaration

public static Map parseAttribute(NodeList abtList) 

Method Source Code

//package com.java2s;

import java.util.HashMap;
import java.util.Map;

import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

public class Main {
    public static Map parseAttribute(NodeList abtList) {
        Map map = new HashMap();
        try {/*  www. j av  a2 s  .c  om*/
            for (int i = 0; i < abtList.getLength(); i++) {
                Node abt = abtList.item(i);
                if (abt.getNodeType() == 1) {
                    map.put(abt.getNodeName(), abt.getTextContent().replace("'", "").replace("?", ""));
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return map;
    }
}

Related

  1. getXmlNodeAttribute(String attributeName, NodeList nodeList)
  2. getXmlNodeAttributeValue(Node NN, String AttrName)
  3. getYesNoAttrVal(final NamedNodeMap nnm, final String name)
  4. hasAttribByName(Element node, String name)
  5. parseAttribute(Node lnNode, String attributeName)
  6. parseAttributes(Node n)
  7. parseAttributes(Node node)
  8. parseAttributesTag(Node n)
  9. xmlGetAttribute(Node node, String attrname)