Changeset 203 in tmcsimulator-scriptbuilder for trunk/src/scriptbuilder/structures/SimulationScript.java
- Timestamp:
- 02/01/2020 04:18:21 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/scriptbuilder/structures/SimulationScript.java
r201 r203 18 18 import java.nio.file.Paths; 19 19 import java.util.TreeMap; 20 import static scriptbuilder.structures.XMLBuilder.prettyPrintXML; 20 21 21 22 /** … … 249 250 250 251 BufferedWriter bw = new BufferedWriter(new FileWriter(f)); 251 bw.write(this.toXML()); 252 // convert to XML and remove newlines 253 String xmlOut = (this.toXML()).replace("\n",""); 254 // pretty print and save to file 255 bw.write(prettyPrintXML(xmlOut)); 252 256 bw.flush(); 253 257 bw.close(); 254 255 258 } 256 259 catch (Exception ex) … … 358 361 ArrayList<TimeSlice> slices = arrangeAllSlices(); 359 362 String output = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n"; 360 output += XML Writer.externalDTD();361 output += XML Writer.openTag(ELEMENT.TMC_SCRIPT.tag + " title=\"" + this.title + "\"");363 output += XMLBuilder.externalDTD(); 364 output += XMLBuilder.openTag(ELEMENT.TMC_SCRIPT.tag + " title=\"" + this.title + "\""); 362 365 363 366 if (units.size() > 0) 364 367 { 365 output += XML Writer.openTag(ELEMENT.SCRIPT_DATA.tag);368 output += XMLBuilder.openTag(ELEMENT.SCRIPT_DATA.tag); 366 369 for (Unit unit : units) 367 370 { 368 371 output += unit.toXML(); 369 372 } 370 output += XML Writer.closeTag(ELEMENT.SCRIPT_DATA.tag);373 output += XMLBuilder.closeTag(ELEMENT.SCRIPT_DATA.tag); 371 374 } 372 375 for (TimeSlice slice : slices) … … 374 377 output += slice.toXML(); 375 378 } 376 output += XML Writer.closeTag(ELEMENT.TMC_SCRIPT.tag);379 output += XMLBuilder.closeTag(ELEMENT.TMC_SCRIPT.tag); 377 380 return output; 378 381 }
Note: See TracChangeset
for help on using the changeset viewer.
