SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
StringIndexMapReader stringMapReader = new StringIndexMapReader();
parser.parse(new InputSource(jtr.getReader()), stringMapReader);
parser.parse(new InputSource(jtr.getReader()), new XmlHandler(handler, stringMapReader.stringMap));
} catch (ParserConfigurationException e) {
throw new CromTreeException("Failed to create the XML parser. " +
"This indicates a serious problem with the Java platform. Reported error: " + e.getMessage(), e);
} catch (SAXException e) {
String msg = "The XML representation of the mapping structure is incorrect. " +
"This is a bug. Reported error: " + e.getMessage();
if (e instanceof SAXParseException) {
SAXParseException parseException = (SAXParseException) e;
msg += " The error occurred at line " +
parseException.getLineNumber() + ", column " + parseException.getColumnNumber() + ".";
}
throw new CromTreeException(msg, e);
} catch (IOException e) {
throw new CromTreeException("An I/O error occurred when reading mapping structure information. " +
"Reported error: " + e.getMessage(), e);
}
}