}
// System.out.println("parse1: " + source.getNameForReporting());
FontManager fontManager = configuration.getFontsConfiguration().getTopLevelManager();
StyleSheet styleSheet = new StyleSheet();
styleSheet.checkDeprecation(configuration.showDeprecationWarnings());
InputStream in = null;
try
{
in = source.getInputStream();
styleSheet.parse(source.getName(),
in,
ThreadLocalToolkit.getLogger(),
fontManager);
}
catch (Exception exception)
{
if (Trace.error)
{
exception.printStackTrace();
}
ParseError parseError = new ParseError(exception.getLocalizedMessage());
parseError.setPath(source.getName());
ThreadLocalToolkit.log(parseError);
return null;
}
finally
{
if (in != null)
{
try
{
in.close();
}
catch (IOException ex)
{
}
}
}
if (styleSheet.errorsExist())
{
// Error
ThreadLocalToolkit.getLogger().log(new StyleSheetParseError(source.getName()));
}