Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Issue in removing a node

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);
   
     }
    
   
  }
  

0 votes



One answer

Permanent link
I don't recognize that API, If you are working on EMF level, you are probably doing something you shouldn't.

0 votes

Comments

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 log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: Jul 22 '13, 3:21 p.m.

Question was seen: 4,546 times

Last updated: Jul 23 '13, 2:39 p.m.

Confirmation Cancel Confirm