X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=server%2Fcom%2Fcompany%2FxmlOperation.java;h=7a07f93fd66a713d5294b799d490f22ed696d3a6;hb=HEAD;hp=f15cd796f6d1e0da27837a8100a39edbbaae8559;hpb=39f6e6d4d05ad6819318e8a372147dd3d4ec6af7;p=logicplayer.git diff --git a/server/com/company/xmlOperation.java b/server/com/company/xmlOperation.java index f15cd79..7a07f93 100644 --- a/server/com/company/xmlOperation.java +++ b/server/com/company/xmlOperation.java @@ -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