import org.xml.sax.Parser; import org.xml.sax.DocumentHandler; import org.xml.sax.helpers.ParserFactory; public class convert { static final String parserClass = "com.ibm.xml.parser.SAXDriver"; //using IBM's XML parser //static final String parserClass = "com.datachannel.xml.sax.SAXDriver"; //in case we want to use the DXP parser static final String xmlfile="c:\\xmlex\\musicians.xml" public static void main (String args[]) throws Exception { Parser parser; //variable declaration //the name parser will be used to refer to a Parser object DocumentHandler handler; //variable declaration //the name handler will be used to refer to a DocumentHandler object parser = ParserFactory.makeParser(parserClass); //A Parser object is created by supplying a class name to the ParserFactory handler = new OurHandler(); //The new object is created and initialized parser.setDocumentHandler(handler); //handler is registered with the parser parser.parse(xmlfile); //our xml-file is parsed } }