This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class SAXReaderExample { | |
| public static final String PATH = "/tmp/resources"; | |
| public static void main(String[] args) throws ParserConfigurationException, SAXException, IOException { | |
| SAXParserFactory spf = SAXParserFactory.newInstance(); | |
| SAXParser sp = spf.newSAXParser(); | |
| XMLReader reader = sp.getXMLReader(); | |
| reader.setContentHandler(new SchemaSaxHandler()); | |
| reader.parse(new InputSource(new FileInputStream(new File(PATH, "source.xsd")))); |