I'm currently trying to get my code to call in an xml file and an xsl - then perform the transformation and output multiple outcome files depending on the xml content.
import javax.xml.transform.*;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;
public class TestTransformation {
public static void main(String[] args) throws TransformerException {
System.setProperty("javax.xml.transform.TransformerFactory","net.sf.saxon.TransformerFactoryImpl");
TransformerFactory tFactory = TransformerFactory.newInstance();
Source xslt = new StreamSource(new File("transformer.xslt"));
Transformer transformer = tFactory.newTransformer(xslt);
Source xmlText = new StreamSource(new File("data.xml"));
transformer.transform(xmlText, new StreamResult(new File("output.xml")));
But i want the transform to produce multiple output files.. Any ideas would be greatly appreciated!!