Here you can find the source of getNodeValue(Node node, String nodeKey)
private static String getNodeValue(Node node, String nodeKey)
//package com.java2s; //License from project: Open Source License import java.util.regex.Matcher; import java.util.regex.Pattern; import org.w3c.dom.Node; public class Main { private static Pattern attrExtractor = Pattern.compile("\"(.*)\""); private static String getNodeValue(Node node, String nodeKey) { Node opt_item = node.getAttributes().getNamedItem(nodeKey); if (opt_item != null) { Matcher nameMatcher = attrExtractor.matcher(opt_item.toString()); if (nameMatcher.find()) { return nameMatcher.group(1); }//from ww w .j a va 2 s. com } return null; } }