Code example for XMLReader

Methods: parse, setContentHandler, setDTDHandler

0
        throws SAXException, ParserConfigurationException, IOException 
    { 
        Verifier verifier = getVerifier(schemaUrl);
        XMLReader reader = saxParser.getXMLReader();
        InputSource source = new InputSource(fileUrl.toString());
		reader.setContentHandler(verifier);
		reader.setDTDHandler(verifier);
        reader.parse(source);
    } 
     
    /** 
     * Returns a thread-exclusive verifier instance. 
     *  
     * @param schemaUrl the URL of the schema to be used. 
     * @return a thread-exclusive verifier instance. 
     * @throws ParserConfigurationException if parser is badly configured. 
     * @throws IOException if the schema does not exist. 
     * @throws SAXException if the schema is malformed. 
     */ 
    public Verifier getVerifier(URL schemaUrl)
        throws SAXException, ParserConfigurationException, IOException