public static SAXSource createSAXSource(InputSource source) throws JAXBException {
  try {
    SAXParser saxParser=getSafeSAXParser(false);
    return new SAXSource(saxParser.getXMLReader(),source);
  }
 catch (  Exception ex) {
    throw new JAXBException("Unable to create SAXSource",ex);
  }
}

public static SAXSource createSAXSource ( InputSource source ) throws JAXBException { try { SAXParser saxParser = getSafeSAXParser ( false ) ; return new SAXSource ( saxParser . getXMLReader ( ) , source ) ; } catch ( Exception ex ) { throw new JAXBException ( "Unable to create SAXSource" , ex ) ; } }
creates a saxsource instance based on the incoming inputsource , which later on can be safely used by jaxb unmarshalling . the saxsource will be protected against different types of entity expansion , dos attacks and makes sure that only locally available dtds can be referenced within the xml document .
