import java.io.*; import com.sun.xml.tree.*; import org.w3c.dom.*; public class OpenWithSun { public static void main (String argv []) { if (argv.length != 1) { System.err.println("Usage: Open filename"); System.exit(1); } FileInputStream inStream; Document document; String xmlDocumentPath = argv[0]; try { inStream = new FileInputStream(xmlDocumentPath); document = XmlDocument.createXmlDocument(inStream,true); } catch (Exception e) { System.out.println("Unexpected exception reading document!" +e); System.exit (0); } System.out.println("Document successfully created!"); System.exit (0); } }