public static XMLReader getXMLReader ( ) throws SAXException { XMLReader reader ; if ( System . getProperty ( SAX_DRIVER_PROPERTY ) != null ) { return XMLReaderFactory . createXMLReader ( ) ; } try { Class . forName ( SAX_DRIVER_DEFAULT_CLASS ) ; reader = XMLReaderFactory . createXMLReader ( SAX_DRIVER_DEFAULT_CLASS ) ; } catch ( final ClassNotFoundException e ) { try { Class . forName ( SAX_DRIVER_SUN_HACK_CLASS ) ; reader = XMLReaderFactory . createXMLReader ( SAX_DRIVER_SUN_HACK_CLASS ) ; } catch ( final ClassNotFoundException ex ) { try { Class . forName ( SAX_DRIVER_CRIMSON_CLASS ) ; reader = XMLReaderFactory . createXMLReader ( SAX_DRIVER_CRIMSON_CLASS ) ; } catch ( final ClassNotFoundException exc ) { reader = XMLReaderFactory . createXMLReader ( ) ; } } } if ( Configuration . DEBUG ) { reader = new DebugXMLReader ( reader ) ; } return reader ; }
Get preferred SAX parser .