I have run into NullPointerException thrown out almost at the end of an XML document process by org.apache.xerces.framework.XMLParser.java on line 969. A closer look at the code indicates the call, fScanner.parseSome(true), throws this exception, after all the element events are fired off. Here is my driver code which looks normal. Anyone can help find what causes the problem here? My code or xerces' code? InputSource inputSource; inputSource = new InputSource("CATALO.xml"); XMLReader saxParser = (XMLReader)Class.forName(parserName).newInstance(); saxParser.setContentHandler(auto); saxParser.setErrorHandler(auto); //saxParser.setFeature("http://apache.org/xml/features/validation/dynamic",t rue); saxParser.setFeature( "http://xml.org/sax/features/validation",false); saxParser.setFeature( "http://xml.org/sax/features/namespaces",true ); saxParser.setFeature( "http://apache.org/xml/features/validation/schema",true ); saxParser.parse(inputSource); Thanks! Richard Wu