Search Java Code Snippets


  Help us in improving the repository. Add new snippets through 'Submit Code Snippet ' link.





#Java - Code Snippets for '#Org.xml.sax.InputSource' - 1 code snippet(s) found

 Sample 1. Sample Code for catching javax.xml.catalog.CatalogException

 public InputSource loadSource(String href, String context, XSLTC xsltc) {
try {
Source source = null;
if (_uriResolver != null) {
source = _uriResolver.resolve(href, context);
}
if (source == null && _catalogFiles != null &&
_xmlFeatures.getFeature(JdkXmlFeatures.XmlFeature.USE_CATALOG)) {
if (_catalogUriResolver == null) {
_catalogUriResolver = CatalogManager.catalogResolver(_catalogFeatures);
}
source = _catalogUriResolver.resolve(href, context);
}
if (source != null) {
return Util.getInputSource(xsltc, source);
}
}
catch (TransformerException e) {
// should catch it when the resolver explicitly throws the exception
final ErrorMsg msg = new ErrorMsg(ErrorMsg.INVALID_URI_ERR, href + "
" + e.getMessage(), this);
xsltc.getParser().reportError(Constants.FATAL, msg);
}
catch (CatalogException e) {
final ErrorMsg msg = new ErrorMsg(ErrorMsg.CATALOG_EXCEPTION, href + "
" + e.getMessage(), this);
xsltc.getParser().reportError(Constants.FATAL, msg);
}

return null;
}

   Like      Feedback     



Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner