public void load()
    {
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();

        try {
            DocumentBuilder builder = factory.newDocumentBuilder();

            builder.setErrorHandler(new org.xml.sax.ErrorHandler() {
                public void fatalError(SAXParseException e) throws SAXException
                {
                    throw e;
                }

                public void error(SAXParseException e) throws SAXParseException
                {
                    throw e;
                }

                public void warning(SAXParseException err)
                        throws SAXParseException
                {
                    System.out.println("** Warning" + ", line "
                            + err.getLineNumber() + ", uri "
                            + err.getSystemId());
                    System.out.println("   " + err.getMessage());
                }
            });

            document = builder.parse(file);

        } catch (SAXParseException spe) {
            System.out.println("\n** Parsing error" + ", line "
                    + spe.getLineNumber() + ", uri " + spe.getSystemId());
            System.out.println("   " + spe.getMessage());

            Exception x = spe;
            if (spe.getException() != null)
                x = spe.getException();
            x.printStackTrace();

        } catch (SAXException sxe) {
            Exception x = sxe;
            if (sxe.getException() != null)
                x = sxe.getException();
            x.printStackTrace();

        } catch (ParserConfigurationException pce) {
            pce.printStackTrace();
        } catch (IOException ioe) {
            ioe.printStackTrace();
        }
    }