
import java.io.*;
import javax.xml.transform.*;
import javax.xml.transform.stream.*;

public class XsltTransform {


    public static final String XSLT = "suffix-sfm-pom.xslt";
    public static void main(String[] args) throws Exception {

        String suffix = args[0];

        Source xsl = new StreamSource(new File(XSLT));

        Transformer transformer = TransformerFactory.newInstance().newTransformer(xsl);

        transformer.setParameter("suffix", suffix);

        for(int i = 1; i < args.length; i++ ) {
            Source xmlInput = new StreamSource(new File(args[i]));
            Result xmlOutput = new StreamResult(new File(args[i] + ".tmp"));

            transformer.transform(xmlInput, xmlOutput);
        }
    }
}
@@ -515,16 +515,95 @@
 i++ ) %7B%0A
+%09    File f = new File(args%5Bi%5D);%0A            File t = new File(args%5Bi%5D + %22~%22);%0A
         
@@ -641,33 +641,17 @@
 mSource(
-new File(args%5Bi%5D)
+f
 );%0A     
@@ -697,34 +697,42 @@
 ult(
-new File(args%5Bi%5D + %22.tmp%22)
+t);%0A%0A%09    f.delete(); t.renameTo(f
 );%0A%0A
@@ -803,9 +803,10 @@
 %7D%0A    %7D%0A
-
 %7D
+%0A

transform rename