Here you can find the source of getTagAttribute(String sTag, String sAtt, Element eElement)
public static String getTagAttribute(String sTag, String sAtt, Element eElement)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class Main { public static String getTagAttribute(String sTag, String sAtt, Element eElement) { Node node;//from w w w . ja va 2 s . c o m String name; NodeList nList = eElement.getChildNodes(); for (int i = 0; i < nList.getLength(); i++) { node = nList.item(i); name = node.getNodeName(); if (name.equals(sTag)) { node = node.getAttributes().getNamedItem(sAtt); if (node != null) return node.getNodeValue().toString(); else return null; } } return null; } }