It's all about the answers!

Ask a question

Issue in removing a node


Lipi Das (2612635) | asked Jul 22 '13, 3:21 p.m.

I am tried to remove one node with this code  below.

But it is removing all nodes with this tag

NodeList defectList = (NodeList) doc.getElementsByTagName("oslc_cm:tracksWorkItem");
   System.out.println("defectList.getLength() "+defectList.getLength());
   for(int i=defectList.getLength()-1;i>=0;i--){
    Element defect = (Element) defectList.item(i);
     String link=defect.getAttribute("rdf:resource");
     String id=link.substring(link.lastIndexOf("/")+1);
         if (id.equals(defectID))
     {
   
      defect.getParentNode().removeChild(defect); 
     
    //  doc.removeChild(defect);
   System.out.println("Removing defect "+ defectID);
   
     }
    
   
  }
  

One answer



permanent link
Ralph Schoon (63.3k33646) | answered Jul 23 '13, 2:36 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
I don't recognize that API, If you are working on EMF level, you are probably doing something you shouldn't.

Comments
Ralph Schoon commented Jul 23 '13, 2:39 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Might be something inside OSLC. Please be aware, in OSLC you need to return all the data that has not been deleted.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.