public XCCDFResults process(SourceContext checklist, ResultContextResolver resultContextResolver, XCCDFOptions options) throws CPEEvaluationException, XCCDFOptionException, ValidationException, XmlException, IOException, CircularReferenceException, ExtensionScopeException, ProfileNotFoundException, ItemNotFoundException, PropertyNotFoundException {
// Validate options
validateOptions(options);
XCCDFDocument document = XCCDFDocumentFactory.getInstance(checklist, options.getTailoringInstance());
log.debug("validating XCCDF content");
if (!document.validate()) {
throw new ValidationException("invalid xccdf document: "+document.getId());
}
ResultContext resultContext;
File resultFile = options.getXccdfResultFile();
if (resultFile != null) {
resultContext = new FileResultContext(checklist, resultContextResolver, resultFile);
} else {
resultContext = resultContextResolver.resolve(checklist, "xccdf-results_", ".xml");
}
/*
* 1 - Load and resolve the Benchmark
*/
if (document.load() && !options.isSuppressXccdfResolved()) {
//File resolvedFile = File.createTempFile("xccdf-resolved", ".xml",resultDirectory);
File resolvedFile = resultContext.getAuxiliaryFile("xccdf-resolved_", ".xml");
log.info("Saving the resolved checklist to: "+resolvedFile.getCanonicalPath());
document.write(resolvedFile);
}
XCCDFProcessor processor = new XCCDFProcessor(document, options, resultContextResolver);