| Revision 203,
910 bytes
checked in by jdalbey, 6 years ago
(diff) |
|
XMLWriter.java name changed to XMLBuilder. Add pretty printing methods (ticket #237).
|
| Line | |
|---|
| 1 | |
|---|
| 2 | package old; |
|---|
| 3 | |
|---|
| 4 | import static scriptbuilder.structures.XMLBuilder.prettyPrintXML; |
|---|
| 5 | |
|---|
| 6 | public class PrettyPrintDemo { |
|---|
| 7 | |
|---|
| 8 | public static void main(String[] args) { |
|---|
| 9 | String xmlString = "<SCRIPT_EVENT><TIME_INDEX>00:00:00</TIME_INDEX><INCIDENT LogNum=\"101\"/><COLOR b=\"255\" g=\"0\" r=\"0\"/><CAD_DATA><CAD_INCIDENT_EVENT><DETAIL>abc</DETAIL></CAD_INCIDENT_EVENT></CAD_DATA></SCRIPT_EVENT>"; |
|---|
| 10 | //String xmlString = "<SCRIPT_EVENT><TIME_INDEX>00:00:45</TIME_INDEX><INCIDENT LogNum=\"101\">Ice Cream</INCIDENT><CMS_EVALUATION cmsID=\"72\" type=\"new\"> <LOCATION>SB 55 @ WARNER AVE</LOCATION><SAMPLE_MESSAGE><CMS_LINE>ACCIDENT AHEAD</CMS_LINE><CMS_LINE>AT 405 OVERPASS</CMS_LINE></SAMPLE_MESSAGE></CMS_EVALUATION></SCRIPT_EVENT>"; |
|---|
| 11 | System.out.println("Input XML : \n" + xmlString); |
|---|
| 12 | // Print the masked XML |
|---|
| 13 | System.out.println("\nXML after formatting : \n" + prettyPrintXML(xmlString)); |
|---|
| 14 | } |
|---|
| 15 | |
|---|
| 16 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.