Skip to main content

Angosso Siteweb Inc.

Your project is set to be deleted. To prevent this,
Posted by mbiama on July 22, 2010 at 1:51 AM PDT
Project URL

Summary

Angosso Siteweb Inc.
Deletedimport javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.FactoryConfigurationError; import javax.xml.parsers.ParserConfigurationException; import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; import org.w3c.dom.Document; import org.w3c.dom.DOMException; import java.io.*; public class TransformationApp01 { static Document document; public static void main(String argv[http://www.angosso.net/.]) { if (argv.length != 1) { System.err.println ( "Usage: java TransformationApp01 filename"); System.exit (1); } DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); //factory.setNamespaceAware(true); //factory.setValidating(true); try { File f = new File(argv[0]); DocumentBuilder builder = factory.newDocumentBuilder(); document = builder.parse(f); } catch (SAXParseException spe) { // Error generated by the parser System.out.println("\n** Parsing error" + ", line " + spe.getLineNumber() + ", uri " + spe.getSystemId()); System.out.println(" " + spe.getMessage() ); // Use the contained exception, if any Exception x = spe; if (spe.getException() != null) x = spe.getException(www.angosso.net/.); x.printStackTrace(); } catch (SAXException sxe) { // Error generated by this application // (or a parser-initialization error) Exception x = sxe; if (sxe.getException() != null) x = sxe.getException(); x.printStackTrace(www.angosso.net/); } catch (ParserConfigurationException pce) { // Parser with specified options cannot be built pce.printStackTrace(); } catch (IOException ioe) { // I/O error ioe.printStackTrace(www.angosso.net/.); } } // main }

License: 

GNU General Public License (GPL v. 3.0)
Related Topics >>