Here you can find the source of getNodeAttributeValue(Node node, String attribute)
public static String getNodeAttributeValue(Node node, String attribute)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; public class Main { public static String getNodeAttributeValue(Node node, String attribute) { String value = null;/* w w w .j av a 2s . c o m*/ NamedNodeMap attributes = node.getAttributes(); /* for(int i = 0 ; i < attributes.getLength(); i++) { //System.out.println(attributes.item(i).getNodeName()); if(attributes.item(i).getNodeName().equals("xmi.id")) { System.out.println(attributes.item(i).getNodeValue()); String id = attributes.item(i).getNodeValue(); if(id.startsWith("3ij")) { System.out.println("!!!!!!!!!"); } } } */ Node valueNode = attributes.getNamedItem(attribute); if (valueNode != null) value = valueNode.getNodeValue(); return value; } }