1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 package org.coach.idltree; 26 27 import java.io.*; 28 import java.util.*; 29 import javax.swing.*; 30 import javax.swing.event.*; 31 import javax.swing.tree.*; 32 import java.awt.*; 33 import java.awt.event.*; 34 35 public class XmlParser { 36 public static void main(String argv[]) { 37 38 IdlNode root = null; 39 try { 40 String xml = ""; 41 if (argv.length == 1) { 42 File f = new File(argv[0]); 43 BufferedReader r = new BufferedReader(new FileReader(f)); 44 StringBuffer sb = new StringBuffer (); 45 String s = r.readLine(); 46 while (s != null) { 47 sb.append(s); 48 s = r.readLine(); 49 } 50 xml = sb.toString(); 51 } 52 60 root = XmlNode.getIdlNodeXml(xml); 61 } catch (Exception e) { 62 e.printStackTrace(); 63 } 64 65 IdlEditor.display("XmlEditor", root); 66 } 67 } 68 | Popular Tags |