public void loadPage(String url_text) throws Exception { logger.info("Loading Page: " + url_text); current_url = url_text;   DocumentBuilderFactory fact = DocumentBuilderFactory.newInstance(); fact.setValidating(true); DocumentBuilder builder = fact.newDocumentBuilder(); builder.setErrorHandler(root.error_handler); Document doc = null;   URL ref = null;  if(url_text.startsWith("demo:")) { DemoMarker marker = new DemoMarker();  String short_url = url_text.substring(5);  if(!short_url.startsWith("/")) { short_url = "/" + short_url; } doc = builder.parse(marker.getClass().getResourceAsStream(short_url)); ref = marker.getClass().getResource(short_url); } else if(url_text.startsWith("http")) { doc = builder.parse(url_text); ref = new File(url_text).toURL(); } else if(url_text.startsWith("file: File file = new File(new URI(url_text)); if(file.isDirectory()) { doc = new DirectoryLister().list(file); ref = file.toURL(); } else { doc = builder.parse(file); ref = file.toURL(); }  } else { doc = builder.parse(url_text); ref = new File(url_text).toURL(); } loadPage(doc,ref);  setStatus("Successfully loaded: " + url_text); if ( listener != null ) { listener.pageLoadSuccess(url_text, view.getDocumentTitle()); }
public void loadPage(Document doc, URL url) throws Exception { view.setDocument(doc,url); view.addDocumentListener(this); root.history.goNewDocument(doc); updateButtons();
    public void loadPage(String url_text) throws Exception {        logger.info("Loading Page: " + url_text);        current_url = url_text;                        DocumentBuilderFactory fact = DocumentBuilderFactory.newInstance();        fact.setValidating(true);        DocumentBuilder builder = fact.newDocumentBuilder();        builder.setErrorHandler(root.error_handler);/*  new ErrorHandler() {            public void warning(SAXParseException ex) throws SAXException {                logger.info("warning: " + ex);            }            public void error(SAXParseException ex) throws SAXException {                logger.info("error: " + ex);                logger.info("error on line: " + ex.getLineNumber() + " column: " + ex.getColumnNumber());                setStatus("Error Loading Document");            }            public void fatalError(SAXParseException ex) throws SAXException {                logger.info("fatal error: " + ex);                logger.info("error on line: " + ex.getLineNumber() + " column: " + ex.getColumnNumber());                setStatus("Error Loading Document");            }        });        */        Document doc = null;                        URL ref = null;                if(url_text.startsWith("demo:")) {            DemoMarker marker = new DemoMarker();            //u.p("marker = " + marker);            String short_url = url_text.substring(5);            //u.p("sub = " + short_url);            if(!short_url.startsWith("/")) {                short_url = "/" + short_url;            }            doc = builder.parse(marker.getClass().getResourceAsStream(short_url));            ref = marker.getClass().getResource(short_url);        } else if(url_text.startsWith("http")) {            doc = builder.parse(url_text);            ref = new File(url_text).toURL();        } else if(url_text.startsWith("file://")) {            File file = new File(new URI(url_text));            if(file.isDirectory()) {                doc = new DirectoryLister().list(file);                ref = file.toURL();            } else {                doc = builder.parse(file);                ref = file.toURL();            }                    } else {            doc = builder.parse(url_text);            ref = new File(url_text).toURL();        }        loadPage(doc,ref);                setStatus("Successfully loaded: " + url_text);        if ( listener != null ) {            listener.pageLoadSuccess(url_text, view.getDocumentTitle());        }    }