Index: tmp/org.txm.core/src/java/org/txm/importer/ApplyXsl2.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/ApplyXsl2.java	(revision 2704)
+++ tmp/org.txm.core/src/java/org/txm/importer/ApplyXsl2.java	(revision 2705)
@@ -18,35 +18,35 @@
 // You should have received a copy of the GNU General
 // Public License along with the TXM platform. If not, see
 // http://www.gnu.org/licenses.
-
-//
-// This file is part of the TXM platform.
-//
-// The TXM platform is free software: you can redistribute it and/or modif y
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// The TXM platform is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with the TXM platform.  If not, see <http://www.gnu.org/licenses/>.
-// 
-// 
-// 
-// $LastChangedDate: 2011-11-03 17:59:23 +0100 (jeu., 03 nov. 2011) $
-// $LastChangedRevision: 2051 $
-// $LastChangedBy: mdecorde $ 
-//
-package org.txm.importer;
-
-/**
- * @author mdecorde
- */
-
+
+//
+// This file is part of the TXM platform.
+//
+// The TXM platform is free software: you can redistribute it and/or modif y
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The TXM platform is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with the TXM platform.  If not, see <http://www.gnu.org/licenses/>.
+// 
+// 
+// 
+// $LastChangedDate: 2011-11-03 17:59:23 +0100 (jeu., 03 nov. 2011) $
+// $LastChangedRevision: 2051 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer;
+
+/**
+ * @author mdecorde
+ */
+
 import java.io.BufferedOutputStream;
 import java.io.BufferedWriter;
 import java.io.File;
@@ -79,80 +79,84 @@
 import org.txm.utils.io.IOUtils;
 import org.txm.utils.logger.Log;
 import org.txm.utils.saxon.SaxonNodeSet;
-
-// TODO: Auto-generated Javadoc
-/**
- * apply a xsl file to a file : use process(File infile, File outfile, String[]
- * args) to apply the xslt file loaded by the constructor args =
- * ["name1","value1","name2",value2, ...]
- * 
- * @author mdecorde
- */
-
-public class ApplyXsl2 {
-
-	//	/** The proc. */
-	//	private Processor proc;
-	//	
-	//	/** The comp. */
-	//	private XsltCompiler comp;
-	//	
-	//	/** The exp. */
-	//	private XsltExecutable exp;
-	//
-	//	/** The source. */
-	//	private XdmNode source;
-	//	
-	//	/** The out. */
-	//	private Serializer out;
-	//	
-	//	/** The trans. */
-	//	private XsltTransformer trans;
-
-	net.sf.saxon.TransformerFactoryImpl tFactory;
-	Transformer transformer;
-	private HashMap<String, Object> params = new HashMap<String, Object>();
+
+// TODO: Auto-generated Javadoc
+/**
+ * apply a xsl file to a file : use process(File infile, File outfile, String[]
+ * args) to apply the xslt file loaded by the constructor args =
+ * ["name1","value1","name2",value2, ...]
+ * 
+ * @author mdecorde
+ */
+
+public class ApplyXsl2 {
+	
+	// /** The proc. */
+	// private Processor proc;
+	//
+	// /** The comp. */
+	// private XsltCompiler comp;
+	//
+	// /** The exp. */
+	// private XsltExecutable exp;
+	//
+	// /** The source. */
+	// private XdmNode source;
+	//
+	// /** The out. */
+	// private Serializer out;
+	//
+	// /** The trans. */
+	// private XsltTransformer trans;
+	
+	net.sf.saxon.TransformerFactoryImpl tFactory;
+	
+	Transformer transformer;
+	
+	private HashMap<String, Object> params = new HashMap<>();
+	
 	private File xsltfile;
-	boolean debug = false;
-
-	/**
-	 * initialize with the xslt file.
-	 *
-	 * @param xsltfile the xsltfile
-	 * @throws TransformerConfigurationException 
-	 */
-	public ApplyXsl2(String xsltfile) throws TransformerConfigurationException {
-
-		System.setProperty("javax.xml.transform.TransformerFactory", "net.sf.saxon.TransformerFactoryImpl");
-
-		this.xsltfile = new File(xsltfile);
+	
+	boolean debug = false;
+	
+	/**
+	 * initialize with the xslt file.
+	 *
+	 * @param xsltfile the xsltfile
+	 * @throws TransformerConfigurationException
+	 */
+	public ApplyXsl2(String xsltfile) throws TransformerConfigurationException {
+		
+		System.setProperty("javax.xml.transform.TransformerFactory", "net.sf.saxon.TransformerFactoryImpl");
+		
+		this.xsltfile = new File(xsltfile);
 		tFactory = new TransformerFactoryImpl();
 		transformer = tFactory.newTransformer(new StreamSource(this.xsltfile));
-		
-
-		//Log.info("new tFactory: "+tFactory);
-		//Log.info("new transformer: "+transformer);
-	}
-
-	/**
-	 * initialize with the xslt file.
-	 *
+		
+		
+		// Log.info("new tFactory: "+tFactory);
+		// Log.info("new transformer: "+transformer);
+	}
+	
+	/**
+	 * initialize with the xslt file.
+	 *
 	 * @param xsltfile the xsltfile
-	 * @throws TransformerConfigurationException 
-	 */
-	public ApplyXsl2(File xsltfile) throws TransformerConfigurationException {
-		this.xsltfile = xsltfile;
-
-		System.setProperty("javax.xml.transform.TransformerFactory", "net.sf.saxon.TransformerFactoryImpl");
-
-		tFactory = new net.sf.saxon.TransformerFactoryImpl();
-		//Log.info("new tFactory: "+tFactory);
-		tFactory.getConfiguration().registerExtensionFunction(new SaxonNodeSet());
-		Log.info(NLS.bind("ApplyXsl2 with the {0} stylesheet.", xsltfile));
-		reload();
-		//Log.info("new transformer: "+transformer);
-	}
-
+	 * @throws TransformerConfigurationException
+	 */
+	public ApplyXsl2(File xsltfile) throws TransformerConfigurationException {
+		this.xsltfile = xsltfile;
+		
+		System.setProperty("javax.xml.transform.TransformerFactory", "net.sf.saxon.TransformerFactoryImpl");
+		
+		tFactory = new net.sf.saxon.TransformerFactoryImpl();
+		// Log.info("new tFactory: "+tFactory);
+		tFactory.getConfiguration().registerExtensionFunction(new SaxonNodeSet());
+		Log.info(NLS.bind("ApplyXsl2 with the {0} stylesheet.", xsltfile));
+		reload();
+		// Log.info("new transformer: "+transformer);
+	}
+	
 	/**
 	 * Set a xslt param.
 	 *
@@ -162,30 +166,15 @@
 	 */
 	public boolean setParams(HashMap<String, String> params) {
 		boolean b = true;
-		for (String k : params.keySet()) b = b & setParam(k, params.get(k));
+		for (String k : params.keySet())
+			b = b & setParam(k, params.get(k));
 		return b;
 	}
 	
 	public void setDebug(boolean d) {
 		this.debug = d;
 	}
-	
-	/**
-	 * Set a xslt param.
-	 *
-	 * @param name the name
-	 * @param value the value
-	 * @return true, if successful
-	 */
-	public boolean setParam(String name, Object value) {
-		if (transformer != null) {
-			transformer.setParameter(name, value);
-			params.put(name, value);
-			return true;
-		} else
-			return false;
-	}
-
+	
 	/**
 	 * Set a xslt param.
 	 *
@@ -193,88 +182,109 @@
 	 * @param value the value
 	 * @return true, if successful
 	 */
+	public boolean setParam(String name, Object value) {
+		if (transformer != null) {
+			transformer.setParameter(name, value);
+			params.put(name, value);
+			return true;
+		}
+		else
+			return false;
+	}
+	
+	/**
+	 * Set a xslt param.
+	 *
+	 * @param name the name
+	 * @param value the value
+	 * @return true, if successful
+	 */
 	@Deprecated
 	public boolean SetParam(String name, Object value) {
 		if (transformer != null) {
 			transformer.setParameter(name, value);
 			params.put(name, value);
 			return true;
-		} else
+		}
+		else
 			return false;
-	}
-	public boolean resetParams() {
-		if (transformer != null) {
-			transformer.reset();
-			params.clear();
-		} else
-			return false;
-		return true;
-	}
-
-	/**
-	 * Force java to clean memory after processing a xslt. If not we might catch
+	}
+	
+	public boolean resetParams() {
+		if (transformer != null) {
+			transformer.reset();
+			params.clear();
+		}
+		else
+			return false;
+		return true;
+	}
+	
+	/**
+	 * Force java to clean memory after processing a xslt. If not we might catch
 	 * a JavaHeapspace Exception
-	 * @throws TransformerConfigurationException 
-	 * 
-	 */
-	private void cleanMemory() throws TransformerConfigurationException {
-		reload();
-		for (String name : params.keySet()) { // reload parameters
-			transformer.setParameter(name, params.get(name));
-		}
-	}
-
-	private boolean reload() throws TransformerConfigurationException {
-		//try {
-			transformer = null;
-			transformer = tFactory.newTransformer(new StreamSource(xsltfile));
-//		} catch (TransformerConfigurationException e) {
-//			org.txm.utils.logger.Log.printStackTrace(e);
-//			Log.severe("Error while reloading transformer: "+e);
-//			System.out.println("Error while reloading transformer: "+e);
-//			return false;
-//		}
-		return true;
-	}
-
-	/**
-	 * Process files with xslt args.
-	 *
-	 * @param xmlinfile file to be processed
-	 * @param xmloutfile output file
-	 * @param args xslt args ["arg1","arg1value","arg2","arg2value"...]
-	 * @return true, if successful
-	 * @throws TransformerException 
-	 * @throws FileNotFoundException 
-	 */
-
-	public boolean process(String xmlinfile, String xmloutfile, String[] args) throws Exception {
-		File infile = new File(xmlinfile);
-		File outfile = new File(xmloutfile);
-		
-		//System.out.println(xmlinfile+" Params: "+Arrays.toString(args));
-		for (int i = 0; i < args.length; i = i + 2) {
-			if (!this.setParam(args[i], args[i + 1]))
-				return false;
-		}
-
-		transformer.transform(new StreamSource(xmlinfile), new StreamResult(new BufferedOutputStream(new FileOutputStream(xmloutfile))));
-		cleanMemory(); // save memory
-		// System.out.println("Done");
-		return true;
-	}
-
-	/**
-	 * Process files without xslt args.
-	 *
-	 * @param xmlinfile the xmlinfile
-	 * @param xmloutfile the xmloutfile. If not set, xmlinfile content is replaced
-	 * @return true, if successful
-	 * @throws TransformerException 
-	 * @throws IOException 
-	 */
-	public boolean process(File xmlinfile, File xmloutfile) throws TransformerException, IOException {
+	 * 
+	 * @throws TransformerConfigurationException
+	 * 
+	 */
+	private void cleanMemory() throws TransformerConfigurationException {
+		reload();
+		for (String name : params.keySet()) { // reload parameters
+			transformer.setParameter(name, params.get(name));
+		}
+	}
+	
+	private boolean reload() throws TransformerConfigurationException {
+		// try {
+		transformer = null;
+		transformer = tFactory.newTransformer(new StreamSource(xsltfile));
+		// } catch (TransformerConfigurationException e) {
+		// org.txm.utils.logger.Log.printStackTrace(e);
+		// Log.severe("Error while reloading transformer: "+e);
+		// System.out.println("Error while reloading transformer: "+e);
+		// return false;
+		// }
+		return true;
+	}
+	
+	/**
+	 * Process files with xslt args.
+	 *
+	 * @param xmlinfile file to be processed
+	 * @param xmloutfile output file
+	 * @param args xslt args ["arg1","arg1value","arg2","arg2value"...]
+	 * @return true, if successful
+	 * @throws TransformerException
+	 * @throws FileNotFoundException
+	 */
+	
+	public boolean process(String xmlinfile, String xmloutfile, String[] args) throws Exception {
+		File infile = new File(xmlinfile);
+		File outfile = new File(xmloutfile);
 		
+		// System.out.println(xmlinfile+" Params: "+Arrays.toString(args));
+		for (int i = 0; i < args.length; i = i + 2) {
+			if (!this.setParam(args[i], args[i + 1]))
+				return false;
+		}
+		
+		transformer.transform(new StreamSource(xmlinfile), new StreamResult(new BufferedOutputStream(new FileOutputStream(xmloutfile))));
+		cleanMemory(); // save memory
+		// System.out.println("Done");
+		return true;
+	}
+	
+	/**
+	 * Process files without xslt args.
+	 *
+	 * @param xmlinfile the xmlinfile
+	 * @param xmloutfile the xmloutfile. If not set, xmlinfile content is replaced
+	 * @return true, if successful
+	 * @throws TransformerException
+	 * @throws IOException
+	 */
+	public boolean process(File xmlinfile, File xmloutfile) throws TransformerException, IOException {
+		
 		// bufferize result in a String
 		StringWriter strWriter = new StringWriter();
 		StreamResult out = new StreamResult(strWriter);
@@ -283,54 +293,54 @@
 		File inputfile_copy = null;
 		
 		if (debug) {
-			//FIXME: old version
-			//File inputfile_copy = new File("/tmp", xmlinfile.getName());
-			//FIXME: new version
+			// FIXME: old version
+			// File inputfile_copy = new File("/tmp", xmlinfile.getName());
+			// FIXME: new version
 			tmp_dir = new File(xmlinfile.getParentFile().getAbsolutePath() + "/tmp");
 			tmp_dir.mkdirs();
 			tmp_dir.deleteOnExit();
 			
 			inputfile_copy = new File(tmp_dir, xmlinfile.getName());
 			
-			System.out.println("copying inputfile to: "+inputfile_copy.getAbsolutePath());
-			//FIXME: old version
-			//inputfile_copy.delete();
-			//FIXME: new version
+			// System.out.println("copying inputfile to: "+inputfile_copy.getAbsolutePath());
+			// FIXME: old version
+			// inputfile_copy.delete();
+			// FIXME: new version
 			inputfile_copy.deleteOnExit();
 			FileCopy.copy(xmlinfile, inputfile_copy);
 			
 		}
-
+		
 		transformer.transform(new StreamSource(xmlinfile), out);
-
+		
 		// then write the result in the result file
 		if (xmloutfile == null) {
 			xmloutfile = xmlinfile;
 		}
 		
-			BufferedWriter w = new BufferedWriter(new FileWriter(xmloutfile));
-			w.write(strWriter.toString());
-//			System.out.println("DEBUG: "+xmloutfile);
-//			System.out.println("     : "+strWriter.toString().substring(0, 60));
-			w.close();
-			
-//			if (debug && inputfile_copy != null) {
-//				//FIXME: old version
-//				//File inputfile_copy = new File("/tmp", xmlinfile.getName());
-//				
-//				String s = Diff.diffFile(inputfile_copy, xmloutfile);
-//				if (s.length() > 0) { // for ultra debug?
-//					System.out.println("Result "+xmlinfile.getName()+" VS "+ xmloutfile.getName()+" diff="+s);
-//				} else {
-//					System.out.println("Warning: no diff between "+inputfile_copy+" and "+ xmloutfile);
-//				}
-//			}
+		BufferedWriter w = new BufferedWriter(new FileWriter(xmloutfile));
+		w.write(strWriter.toString());
+		// System.out.println("DEBUG: "+xmloutfile);
+		// System.out.println(" : "+strWriter.toString().substring(0, 60));
+		w.close();
 		
-
-		cleanMemory();
-		return true;
-	}
-
+		// if (debug && inputfile_copy != null) {
+		// //FIXME: old version
+		// //File inputfile_copy = new File("/tmp", xmlinfile.getName());
+		//
+		// String s = Diff.diffFile(inputfile_copy, xmloutfile);
+		// if (s.length() > 0) { // for ultra debug?
+		// System.out.println("Result "+xmlinfile.getName()+" VS "+ xmloutfile.getName()+" diff="+s);
+		// } else {
+		// System.out.println("Warning: no diff between "+inputfile_copy+" and "+ xmloutfile);
+		// }
+		// }
+		
+		
+		cleanMemory();
+		return true;
+	}
+	
 	/**
 	 * Transform files and select files : nor hidden and nor technical (DTD, XSL, etc.)
 	 * 
@@ -339,14 +349,13 @@
 	 * @param outdir
 	 * @return
 	 * @throws TransformerException
-	 * @throws IOException 
-	 */
-	public static boolean processImportSources(File xslFile, File srcdir, File outdir) throws TransformerException, IOException
-	{
-		HashMap<String, Object> params = new HashMap<String, Object>();
-		return processImportSources(xslFile, srcdir, outdir, params);
+	 * @throws IOException
+	 */
+	public static boolean processImportSources(File xslFile, File srcdir, File outdir) throws TransformerException, IOException {
+		HashMap<String, Object> params = new HashMap<>();
+		return processImportSources(xslFile, srcdir, outdir, params);
 	}
-
+	
 	/**
 	 * Transform files and select files : nor hidden and nor technical (DTD, XSL, etc.)
 	 * 
@@ -356,13 +365,12 @@
 	 * @param params XSL parameters
 	 * @return
 	 * @throws TransformerException
-	 * @throws IOException 
+	 * @throws IOException
 	 */
-	public static boolean processImportSources(File xslFile, File srcdir, File outdir, HashMap<String, Object> params) throws TransformerException, IOException
-	{
+	public static boolean processImportSources(File xslFile, File srcdir, File outdir, HashMap<String, Object> params) throws TransformerException, IOException {
 		return processImportSources(xslFile, srcdir, outdir, params, false);
 	}
-
+	
 	/**
 	 * 
 	 * @param srcdir directory
@@ -370,6 +378,7 @@
 	 */
 	public static File[] listFiles(File srcdir) {
 		File[] files = srcdir.listFiles(new FileFilter() {
+			
 			@Override
 			public boolean accept(File f) {
 				String name = f.getName();
@@ -387,7 +396,7 @@
 		});
 		return files;
 	}
-	
+	
 	/**
 	 * Transform files and select files : nor hidden and nor technical (DTD, XSL, etc.)
 	 * 
@@ -397,12 +406,11 @@
 	 * @param params XSL parameters
 	 * @return
 	 * @throws TransformerException
-	 * @throws IOException 
-	 */
-	public static boolean processImportSources(File xslFile, File srcdir, File outdir, HashMap<String, Object> params, boolean deleteOutput) throws TransformerException, IOException
-	{
-		outdir.mkdir();
-		if (xslFile.exists()) {
+	 * @throws IOException
+	 */
+	public static boolean processImportSources(File xslFile, File srcdir, File outdir, HashMap<String, Object> params, boolean deleteOutput) throws TransformerException, IOException {
+		outdir.mkdir();
+		if (xslFile.exists()) {
 			ApplyXsl2 builder = new ApplyXsl2(xslFile);
 			boolean debug = Log.getLevel().intValue() < Level.INFO.intValue();
 			if (debug) {
@@ -411,46 +419,48 @@
 			}
 			if (!params.containsKey("output-directory"))
 				params.put("output-directory", outdir.getAbsoluteFile().toURI().toString());
-			
-			for (String name : params.keySet())
+			
+			for (String name : params.keySet())
 				builder.setParam(name, params.get(name));
 			
 			File[] files = listFiles(srcdir); // get files XSL compatible
 			if (files == null) return false;
-			
-			System.out.println("-- Applying "+xslFile+" XSL to "+files.length+" (from "+srcdir+") files with parameters: "+params+" on directory "+srcdir+" result written in "+outdir);
-
-			ConsoleProgressBar cpb = new ConsoleProgressBar(files.length);
+			
+			System.out.println("-- Applying " + xslFile + " XSL to " + files.length + " (from " + srcdir + ") files with parameters: " + params + " on directory " + srcdir + " result written in "
+					+ outdir);
+			
+			ConsoleProgressBar cpb = new ConsoleProgressBar(files.length);
 			for (File f : files) {
-				String name = f.getName();
-
-				cpb.tick();
+				String name = f.getName();
+				
+				cpb.tick();
 				File outfile = new File(outdir, name);
 				
 				if (!f.getAbsolutePath().equals(outfile.getAbsolutePath()) && f.lastModified() <= outfile.lastModified()) {
-					if (debug) System.out.println("skipped: "+f);
+					if (debug) System.out.println("skipped: " + f);
 					continue; // input file is older than output file
 				}
 				
 				if (deleteOutput) outfile = null; // if outfile is null builder.process won't create the output file adn will replace f
-
-				if (!builder.process(f, outfile)) {
-					System.out.println("Failed to process file "+ f);
-					if (outfile != null) outfile.delete();
+				
+				if (!builder.process(f, outfile)) {
+					System.out.println("Failed to process file " + f);
+					if (outfile != null) outfile.delete();
 				}
-			}
-			System.out.println("");
-			return true;
-		} else {
-			System.out.println("XSL file does not exists: "+ xslFile);
-		}
-		return false;
+			}
+			System.out.println("");
+			return true;
+		}
+		else {
+			System.out.println("XSL file does not exists: " + xslFile);
+		}
+		return false;
 	}
-
+	
 	/**
 	 * Transform files and select files : nor hidden and nor technical (DTD, XSL, etc.)
 	 * 
-	 * Apply one XSL, XML files are replaced 
+	 * Apply one XSL, XML files are replaced
 	 * 
 	 * @param xslFile
 	 * @param pSrcDirectory
@@ -458,17 +468,16 @@
 	 * @param params XSL parameters
 	 * @return
 	 * @throws TransformerException
-	 * @throws IOException 
+	 * @throws IOException
 	 */
-	public static boolean processImportSources(File xslFile, List<File> files, HashMap<String, Object> params) throws TransformerException, IOException
-	{
+	public static boolean processImportSources(File xslFile, List<File> files, HashMap<String, Object> params) throws TransformerException, IOException {
 		return processImportSources(xslFile, files.toArray(new File[files.size()]), params);
 	}
-		
+	
 	/**
 	 * Transform files and select files : nor hidden and nor technical (DTD, XSL, etc.)
 	 * 
-	 * Apply one XSL, XML files are replaced 
+	 * Apply one XSL, XML files are replaced
 	 * 
 	 * @param xslFile
 	 * @param pSrcDirectory
@@ -476,21 +485,20 @@
 	 * @param params XSL parameters
 	 * @return
 	 * @throws TransformerException
-	 * @throws IOException 
+	 * @throws IOException
 	 */
-	public static boolean processImportSources(File xslFile, File[] files, HashMap<String, Object> params) throws TransformerException, IOException
-	{
+	public static boolean processImportSources(File xslFile, File[] files, HashMap<String, Object> params) throws TransformerException, IOException {
 		if (xslFile.exists()) {
 			ApplyXsl2 builder = new ApplyXsl2(xslFile);
-			for(String name : params.keySet())
+			for (String name : params.keySet())
 				builder.setParam(name, params.get(name));
-
+			
 			if (files == null) return false;
 			
-			System.out.println("-- Applying "+xslFile+" XSL to "+files.length+" files with parameters: "+params);
+			System.out.println("-- Applying " + xslFile + " XSL to " + files.length + " files with parameters: " + params);
 			
 			ConsoleProgressBar cpb = new ConsoleProgressBar(files.length);
-
+			
 			for (File f : files) {
 				String name = f.getName();
 				if (f.isHidden() || f.isDirectory()) continue;
@@ -499,28 +507,29 @@
 				if (name.endsWith(".csv")) continue;
 				if (name.endsWith(".dtd")) continue;
 				if (name.endsWith(".xsl")) continue;
-				if (name.endsWith("~"))	continue;
+				if (name.endsWith("~")) continue;
 				if (name.startsWith(".")) continue;
 				
 				if (!ValidateXml.test(f)) {
-					System.out.println("src file "+f+", is not XML valid");
+					System.out.println("src file " + f + ", is not XML valid");
 					return false;
 				}
 				cpb.tick();
 				
 				if (!builder.process(f, null)) {
-					System.out.println("Failed with file "+ f);
+					System.out.println("Failed with file " + f);
 				}
 			}
 			System.out.println("");
 			return true;
-		} else {
-			System.out.println("XSL file does not exists: "+ xslFile);
 		}
+		else {
+			System.out.println("XSL file does not exists: " + xslFile);
+		}
 		return false;
 	}
-
-	/** 
+	
+	/**
 	 * Apply the XSL listed in the xslDirectory. Files are replaced
 	 * 
 	 * @param filesToProcess
@@ -535,13 +544,14 @@
 			File[] xslFiles = xslDirectory.listFiles(IOUtils.HIDDENFILE_FILTER);
 			Arrays.sort(xslFiles);
 			return processWithMultipleXSL(filesToProcess, xslFiles, xslParams);
-		} else {
+		}
+		else {
 			System.out.println("Nothing to do.");
 		}
 		return true;
 	}
-
-	/** 
+	
+	/**
 	 * Apply the XSL list. Files are replaced
 	 * 
 	 * @param filesToProcess
@@ -552,56 +562,57 @@
 	 * @throws IOException
 	 */
 	public static boolean processWithMultipleXSL(File[] filesToProcess, File[] xslFiles, HashMap<String, Object> xslParams) throws TransformerException, IOException {
-
+		
 		Arrays.sort(xslFiles);
 		for (File xslFile : xslFiles) {
 			if (xslFile.isDirectory() || xslFile.isHidden() || !xslFile.getName().endsWith(".xsl")) continue;
 			
 			if (processImportSources(xslFile, filesToProcess, xslParams)) {
 				System.out.println("");
-			} else {
+			}
+			else {
 				return false;
 			}
 		}
-
+		
 		return true;
-	}
-
-	/**
-	 * The main method.
-	 *
-	 * @param args the arguments
-	 * @throws TransformerException 
-	 * @throws FileNotFoundException 
-	 */
-	public static void main(String[] args) throws Exception {
-		//String xslfile = "/home/mdecorde/TXM/xsl/breakByMilestone.xsl";
-		String xslfile = "G:/Feuilles de style/filtre-frantext-query-export4txm.xsl";
-		File xslFile = new File(xslfile);
-		ApplyXsl2 a = new ApplyXsl2(xslFile);
-
-		//File srcdirectory = new File("/home/mdecorde/TXM/corpora/transcribertest/HTML");
-		File srcdirectory = new File("C:/Documents and Settings/alavrent/xml/applyxsl");
-		assert(srcdirectory.exists());
-		assert(srcdirectory.isDirectory());
-		assert(srcdirectory.canRead());
-		assert(srcdirectory.canExecute());
-
-		File[] files = srcdirectory.listFiles(IOUtils.HIDDENFILE_FILTER);
-		System.out.println("process : "+srcdirectory+"/*");
-		System.out.println("with : "+xslfile);
-		long bigstart = System.currentTimeMillis();
-		for (File infile : files) {
-			if (infile.canRead() && infile.getName().endsWith(".xml")) {
-				File outfile = new File(infile.getAbsolutePath()+".out.xml");
-				long start = System.currentTimeMillis();
-				System.out.println("Process : "+infile.getName()+ " >> ");
-				//String[] params = {"pbval1",""+1,"pbval2",""+2};
-				a.process(infile,outfile); // no parameters
-				//a.process( infile.getAbsolutePath() ,outfile,params);
-				System.out.println("Done : "+(System.currentTimeMillis()-start)+"ms");
-			}
-		}
-		System.out.println("Total time : "+(System.currentTimeMillis()-bigstart)+"ms");
-	}
-}
+	}
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 * @throws TransformerException
+	 * @throws FileNotFoundException
+	 */
+	public static void main(String[] args) throws Exception {
+		// String xslfile = "/home/mdecorde/TXM/xsl/breakByMilestone.xsl";
+		String xslfile = "G:/Feuilles de style/filtre-frantext-query-export4txm.xsl";
+		File xslFile = new File(xslfile);
+		ApplyXsl2 a = new ApplyXsl2(xslFile);
+		
+		// File srcdirectory = new File("/home/mdecorde/TXM/corpora/transcribertest/HTML");
+		File srcdirectory = new File("C:/Documents and Settings/alavrent/xml/applyxsl");
+		assert (srcdirectory.exists());
+		assert (srcdirectory.isDirectory());
+		assert (srcdirectory.canRead());
+		assert (srcdirectory.canExecute());
+		
+		File[] files = srcdirectory.listFiles(IOUtils.HIDDENFILE_FILTER);
+		System.out.println("process : " + srcdirectory + "/*");
+		System.out.println("with : " + xslfile);
+		long bigstart = System.currentTimeMillis();
+		for (File infile : files) {
+			if (infile.canRead() && infile.getName().endsWith(".xml")) {
+				File outfile = new File(infile.getAbsolutePath() + ".out.xml");
+				long start = System.currentTimeMillis();
+				System.out.println("Process : " + infile.getName() + " >> ");
+				// String[] params = {"pbval1",""+1,"pbval2",""+2};
+				a.process(infile, outfile); // no parameters
+				// a.process( infile.getAbsolutePath() ,outfile,params);
+				System.out.println("Done : " + (System.currentTimeMillis() - start) + "ms");
+			}
+		}
+		System.out.println("Total time : " + (System.currentTimeMillis() - bigstart) + "ms");
+	}
+}
