@ Override public InputSource resolveEntity ( String publicId , String systemId ) throws SAXException { if ( validating ) { try { InputSource source = null ; if ( publicId != null ) { String path = doctypeMap . get ( publicId . toUpperCase ( ) ) ; source = getInputSource ( path ) ; } if ( source == null && systemId != null ) { String path = doctypeMap . get ( systemId . toUpperCase ( ) ) ; source = getInputSource ( path ) ; } return source ; } catch ( Exception e ) { throw new SAXException ( e . toString ( ) ) ; } } else { return new InputSource ( new StringReader ( "" ) ) ; } }
Converts a public DTD into a local one .