use of javax.xml.transform.dom.DOMResult in project ddf by codice.
the class SchematronValidationService method performStage.
private DOMResult performStage(Source input, URL preprocessorUrl) throws TransformerException, ParserConfigurationException, SchematronInitializationException {
Source preprocessorSource = new StreamSource(preprocessorUrl.toString());
// Initialize container for warnings we may receive during transformation of input
warnings = new Vector<>();
Transformer transformer = transformerFactory.newTransformer(preprocessorSource);
// Setup an error listener to catch warnings and errors generated during transformation
transformer.setErrorListener(new Listener());
// Transform the input using the preprocessor's transformer, capturing the output in a DOM
DOMResult domResult = new DOMResult();
transformer.transform(input, domResult);
return domResult;
}
Aggregations