I am performing a xslt transformation from one xml format to another with saxon and xslt, after what transforming the result xml into Java DOM to work with it further:
System.setProperty("javax.xml.transform.TransformerFactory", "net.sf.saxon.TransformerFactoryImpl");
TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer = tFactory.newTransformer(new StreamSource(new File("xslt.xsl")));
transformer.transform(new StreamSource(new File(inputXML)),
new StreamResult(new File (outputXML)));
DocumentBuilder documentBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document document = documentBuilder.parse(outputXML);
What I don't like in this situation, is creating intermediate outputXML
file. Is it possible to avoid its creating?