Java XML NodeList getEnvVariableMap(NodeList nodes)

Here you can find the source of getEnvVariableMap(NodeList nodes)

Description

get Env Variable Map

License

Open Source License

Declaration

private static Map<String, String> getEnvVariableMap(NodeList nodes) 

Method Source Code

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

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

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

public class Main {
    private static Map<String, String> getEnvVariableMap(NodeList nodes) {
        Map<String, String> map = new HashMap<String, String>();
        for (int i = 0; i < nodes.getLength(); i++) {
            Node node = nodes.item(i);
            String name = node.getAttributes().getNamedItem("name").getTextContent();
            String value = node.getTextContent();
            map.put(name, value);/*from www.  j  a va 2s. c  o  m*/
        }
        return map;
    }
}

Related

  1. getElementFromNodeList(NodeList nl)
  2. getElementList(NodeList list)
  3. getElements(NodeList nodeList, String localname, String namespaceURI)
  4. getElementsFromNodeList(final NodeList nodeList)
  5. getElementsOfNodeList(NodeList nodeList)
  6. getFirst(NodeList nodes)
  7. getFirstElement(NodeList list)
  8. getFirstElement(NodeList list)
  9. getFirstElement(NodeList nodes)