Here you can find the source of getAllXmiIds(Element rootElement, String elementName)
public static ArrayList<String> getAllXmiIds(Element rootElement, String elementName)
//package com.java2s; /*L/*from www.ja v a2 s .co m*/ * Copyright Georgetown University, Washington University. * * Distributed under the OSI-approved BSD 3-Clause License. * See http://ncip.github.com/cab2b/LICENSE.txt for details. */ import java.util.ArrayList; import org.w3c.dom.Element; import org.w3c.dom.NodeList; public class Main { public static ArrayList<String> getAllXmiIds(Element rootElement, String elementName) { ArrayList<String> xmiIdList = new ArrayList<String>(); Element element = null; String xmiId = null; NodeList nodeList = rootElement.getElementsByTagName(elementName); if (nodeList != null) { for (int nodeIndex = 0; nodeIndex < nodeList.getLength(); nodeIndex++) { element = (Element) nodeList.item(nodeIndex); xmiId = element.getAttribute("xmi.id"); xmiIdList.add(xmiId); } } return xmiIdList; } }