Java tutorial
//package com.java2s; import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class Main { public static String getOnlyIdOfXmiAttribute(NodeList elements, int i) { Node href = elements.item(i).getAttributes().getNamedItem("href"); if (href != null) { String currentValue = href.getNodeValue(); return currentValue.substring(currentValue.indexOf("#") + 1, currentValue.length()); } else { return null; } } }