catch (XMLParseException e) {
Exception ex = e.getException();
if (ex == null || ex instanceof CharConversionException) {
// must be a parser exception; mine it for locator info
// and throw a SAXParseException
Locator2Impl locatorImpl = new Locator2Impl();
// since XMLParseExceptions know nothing about encoding,
// we cannot return anything meaningful in this context.
// We *could* consult the LocatorProxy, but the
// application can do this itself if it wishes to possibly
// be mislead.
locatorImpl.setXMLVersion(fVersion);
locatorImpl.setPublicId(e.getPublicId());
locatorImpl.setSystemId(e.getExpandedSystemId());
locatorImpl.setLineNumber(e.getLineNumber());
locatorImpl.setColumnNumber(e.getColumnNumber());
throw (ex == null) ?
new SAXParseException(e.getMessage(), locatorImpl) :
new SAXParseException(e.getMessage(), locatorImpl, ex);
}
if (ex instanceof SAXException) {