]> matita.cs.unibo.it Git - logicplayer.git/blobdiff - server/com/company/xmlOperation.java
New version
[logicplayer.git] / server / com / company / xmlOperation.java
index f15cd796f6d1e0da27837a8100a39edbbaae8559..7a07f93fd66a713d5294b799d490f22ed696d3a6 100644 (file)
@@ -105,16 +105,17 @@ public class xmlOperation {
 
             Document doc = (Document) builder.build(xmlFile);
             Element rootNode = doc.getRootElement();
-
-            for(Element esercizio:rootNode.getChildren())
+            Element tmp = null;
+            for(Element esercizio : rootNode.getChildren())
             {
                 if(esercizio.getText().contentEquals(name))
                 {
-                    System.out.println("trovato");
-                    rootNode.removeContent(esercizio);
+                    tmp=esercizio;
+                    break;
                 }
             }
-
+            if(tmp!=null)
+                rootNode.removeContent(tmp);
             XMLOutputter xmlOutput = new XMLOutputter();
 
             // display nice nice