} else {
logger.log(TreeLogger.DEBUG, "Invalidating cached stylesheet");
}
}
Parser p = new Parser();
Errors errors = new Errors(logger);
GenerationHandler g = new GenerationHandler(errors);
p.setDocumentHandler(g);
p.setErrorHandler(errors);
for (URL stylesheet : sheets) {
TreeLogger branchLogger = logger.branch(TreeLogger.DEBUG,
"Parsing CSS stylesheet " + stylesheet.toExternalForm());
try {
p.parseStyleSheet(stylesheet.toURI().toString());
continue;
} catch (CSSException e) {
branchLogger.log(TreeLogger.ERROR, "Unable to parse CSS", e);
} catch (IOException e) {
branchLogger.log(TreeLogger.ERROR, "Unable to parse CSS", e);