Skip to content

Instantly share code, notes, and snippets.

@edipofederle
Created May 24, 2013 13:50
Show Gist options
  • Select an option

  • Save edipofederle/5643652 to your computer and use it in GitHub Desktop.

Select an option

Save edipofederle/5643652 to your computer and use it in GitHub Desktop.
private Node getReference(String profileName, String tagName){
NodeList elements = docUml.getElementsByTagName("profileApplication");
for (int i = 0; i < elements.getLength(); i++) {
NodeList childs = (elements.item(i).getChildNodes());
for (int j = 0; j < childs.getLength(); j++) {
if(childs.item(j).getNodeName().equalsIgnoreCase("eAnnotations")){
for (int k = 0; k < childs.item(j).getChildNodes().getLength(); k++) {
if(childs.item(j).getChildNodes().item(k).getNodeName().equalsIgnoreCase("references")){
NodeList eAnnotationsChilds = childs.item(j).getChildNodes();
for (int l = 0; l < eAnnotationsChilds.getLength(); l++) {
if(eAnnotationsChilds.item(l).getNodeName().equalsIgnoreCase("references")
&& (eAnnotationsChilds.item(l).getAttributes().getNamedItem("href").getNodeValue().contains(profileName))){
return eAnnotationsChilds.item(l);
}
}
}
}
}
}
}
return null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment