00053 {
00054
if (args.length == 1) {
00055 String xmlFileName = args[0];
00056 FileReader reader = null;
00057
try {
00058 reader =
new FileReader( xmlFileName );
00059 TreeBuilder builder =
new TreeBuilder();
00060 TreeNode root = builder.parseXML( reader );
00061
if (root != null) {
00062 TreeToXML t =
new TreeToXML( root );
00063 String s = t.toString();
00064
if (s != null) {
00065 System.out.println(
"XML:");
00066 System.out.println( s );
00067 }
00068
else {
00069 System.out.println(
"serialized TreeNode tree is null");
00070 }
00071 }
00072
else {
00073 System.out.println(
"root is null");
00074 }
00075 }
catch (FileNotFoundException e) {
00076 System.out.println(
"Error opening file " + xmlFileName +
" = " + e);
00077 }
catch (IOException e1) {
00078 System.out.println(xmlFileName +
": IOException = " + e1 );
00079 }
catch (XmlPullParserException e2) {
00080
printXMLPullError( e2, xmlFileName );
00081 }
00082 }
00083
else {
00084
usage();
00085 }
00086
00087 }