public static void parse(URL xmlURL, URL schema, DefaultHandler handler, LexicalHandler lHandler) throws SAXException, IOException, ParserConfigurationException { InputStream xmlStream = null; InputStream schemaStream = null; try { if (schema != null) { schemaStream = URLHandlerRegistry.getDefault().openStream(schema); } xmlStream = URLHandlerRegistry.getDefault().openStream(xmlURL); SAXParser parser = XMLHelper.newSAXParser(schema, schemaStream);  if (lHandler != null) { try { parser.setProperty("http: } catch (SAXException ex) { System.err.println("WARNING: problem while setting the lexical handler property on SAXParser: " + ex.getMessage());  } }  parser.parse(xmlStream, handler); } finally { if (xmlStream != null) { try { xmlStream.close(); } catch (IOException ex) { } } if (schemaStream != null) { try { schemaStream.close(); } catch (IOException ex) { } } }
public static void parse(URL xmlURL, URL schema, DefaultHandler handler) throws SAXException, IOException, ParserConfigurationException { parse(xmlURL, schema, handler, null);
    public static void parse(URL xmlURL, URL schema, DefaultHandler handler, LexicalHandler lHandler) throws SAXException, IOException, ParserConfigurationException {        InputStream xmlStream = null;        InputStream schemaStream = null;        try {            if (schema != null) {                schemaStream = URLHandlerRegistry.getDefault().openStream(schema);            }            xmlStream = URLHandlerRegistry.getDefault().openStream(xmlURL);            SAXParser parser = XMLHelper.newSAXParser(schema, schemaStream);                        if (lHandler != null) {            	try {            		parser.setProperty("http://xml.org/sax/properties/lexical-handler", lHandler);            	} catch (SAXException ex) {                    System.err.println("WARNING: problem while setting the lexical handler property on SAXParser: " + ex.getMessage());                    // continue without the lexical handler            	}            }                        parser.parse(xmlStream, handler);        } finally {            if (xmlStream != null) {                try {                    xmlStream.close();                } catch (IOException ex) {                }            }            if (schemaStream != null) {                try {                    schemaStream.close();                } catch (IOException ex) {                }            }        }    }