Index: tmp/org.txm.searchengine.core/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.searchengine.core/META-INF/MANIFEST.MF	(revision 880)
+++ tmp/org.txm.searchengine.core/META-INF/MANIFEST.MF	(revision 881)
@@ -1,7 +1,5 @@
 Manifest-Version: 1.0
-Require-Bundle: org.eclipse.core.runtime;visibility:=reexport,org.txm.
- core;bundle-version="0.7.0";visibility:=reexport,org.txm.utils;visibi
- lity:=reexport
+Require-Bundle: org.txm.core;bundle-version="0.7.0";visibility:=reexport
 Export-Package: org.txm.searchengine.core
 Bundle-ActivationPolicy: lazy
 Bundle-Version: 1.0.0.qualifier
Index: tmp/org.txm.core/src/java/org/txm/Toolbox.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/Toolbox.java	(revision 880)
+++ tmp/org.txm.core/src/java/org/txm/Toolbox.java	(revision 881)
@@ -52,6 +52,7 @@
 import org.eclipse.core.runtime.preferences.IPreferencesService;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.Version;
+import org.txm.core.engines.Engine;
 import org.txm.core.engines.EngineType;
 import org.txm.core.engines.EnginesManager;
 import org.txm.core.messages.TXMCoreMessages;
@@ -153,7 +154,7 @@
 	}
 
 	
-	public static EnginesManager<?> getEngineManager(EngineType et) {
+	public static EnginesManager<? extends Engine> getEngineManager(EngineType et) {
 
 		if (enginesManagers == null) {
 			return null;
Index: tmp/org.txm.core/src/java/org/txm/core/engines/Engine.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/core/engines/Engine.java	(revision 880)
+++ tmp/org.txm.core/src/java/org/txm/core/engines/Engine.java	(revision 881)
@@ -16,7 +16,7 @@
 	 */
 	public String getName();
 	
-	public abstract boolean getState();
+	public abstract boolean isRunning();
 	
 	public abstract boolean initialize() throws Exception;
 	
Index: tmp/org.txm.core/src/java/org/txm/core/engines/EnginesManager.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/core/engines/EnginesManager.java	(revision 880)
+++ tmp/org.txm.core/src/java/org/txm/core/engines/EnginesManager.java	(revision 881)
@@ -8,67 +8,64 @@
 import org.txm.utils.logger.Log;
 
 /**
- * Extension point for an Engine (eg. Search engine, Stats engine, etc.). It is a service that may be used by TXM commands.
- * The Toolbox will manage the engines life-cycle. 
+ * Extension point for an Engine (eg. Search engine, Stats engine, etc.). It is
+ * a service that may be used by TXM commands. The Toolbox will manage the
+ * engines life-cycle.
  * 
  * @author mdecorde
  * @author sjacquot
  *
  */
 public abstract class EnginesManager<T extends Engine> {
-	
-	
+
 	public static final String ENGINES_MANAGER_EXTENSION_POINT_ID = EnginesManager.class.getName();
-	
+
 	/**
 	 * Managed engines map (name => engine).
 	 */
 	protected HashMap<String, T> engines = new HashMap<String, T>();
-	
-	
+
 	/**
 	 * Current engine.
 	 */
-	protected T currentEngine = null; 
-	
-	
-	
+	protected T currentEngine = null;
+
 	/**
 	 * Finds out the engines that matches this manager engines extension point.
 	 * 
 	 * @return
 	 */
 	public abstract boolean fetchEngines();
-	
-	
-	
+
 	/**
-	 * Creates and initializes the engines from contributions with the specified extension point id.
+	 * Creates and initializes the engines from contributions with the specified
+	 * extension point id.
 	 * 
 	 * @param engineExtensionPointId
 	 * @return true if at least one engine has been created otherwise false
 	 */
 	protected boolean fetchEngines(String engineExtensionPointId) {
 
-		IConfigurationElement[] contributions = RegistryFactory.getRegistry().getConfigurationElementsFor(engineExtensionPointId);
+		IConfigurationElement[] contributions = RegistryFactory.getRegistry()
+				.getConfigurationElementsFor(engineExtensionPointId);
 
-		Log.finest("Looking for " + this.getEnginesDescription() + " engines contributions with extension point id " + engineExtensionPointId + "."); //$NON-NLS-1$
+		Log.finest("Looking for " + this.getEnginesDescription() + " engines contributions with extension point id " //$NON-NLS-1$
+				+ engineExtensionPointId + ".");
 		Log.finest(contributions.length + " engine(s) found."); //$NON-NLS-1$
-		
+
 		for (int i = 0; i < contributions.length; i++) {
 			try {
 				@SuppressWarnings("unchecked")
-				T e = (T)contributions[i].createExecutableExtension("class"); //$NON-NLS-1$
-				
+				T e = (T) contributions[i].createExecutableExtension("class"); //$NON-NLS-1$
+
 				Log.info("Initializing engine: " + e);
-				
+
 				if (e.initialize()) {
 					this.engines.put(e.getName(), e);
-				}
-				else {
+				} else {
 					Log.severe("Failed to initialize " + e.getName() + " engine.");
 				}
-			} catch(Exception e) {
+			} catch (Exception e) {
 				Log.severe("Error: failed to instantiate " + contributions[i].getName() + ".");
 				e.printStackTrace();
 			}
@@ -76,22 +73,23 @@
 
 		return this.engines.size() > 0;
 	}
-	
+
 	/**
 	 * Starts the engines.
+	 * 
 	 * @param monitor
 	 * @return
 	 */
 	public boolean startEngines(IProgressMonitor monitor) {
 		for (Engine engine : this.engines.values()) {
-			
+
 			String log = "Starting " + this.getEnginesDescription() + " engine: " + engine.getName() + "...";
 			Log.info(log);
-			
+
 			if (monitor != null) {
 				monitor.subTask(log);
 			}
-			
+
 			try {
 				engine.start(monitor);
 			} catch (Exception e) {
@@ -99,18 +97,35 @@
 				e.printStackTrace();
 			}
 		}
+
+		if (currentEngine == null && this.engines.size() > 0) {
+			currentEngine = this.engines.get(0);
+		}
 		return true;
 	}
 
 	/**
+	 * 
+	 * @return true if at least one engine is ready
+	 */
+	public boolean isCurrentEngineAvailable() {
+		if (currentEngine == null) {
+			return false;
+		}
+
+		return currentEngine.isRunning();
+	}
+
+	/**
 	 * Stops the engines.
+	 * 
 	 * @return
 	 */
 	public boolean stopEngines() {
 		for (Engine engine : this.engines.values()) {
-			
+
 			Log.finest("Stopping " + this.getEnginesDescription() + " engine: " + engine.getName() + "..."); //$NON-NLS-1$
-			
+
 			try {
 				engine.stop();
 			} catch (Exception e) {
@@ -121,7 +136,6 @@
 		return true;
 	}
 
-	
 	/**
 	 * Restarts the engines.
 	 * 
@@ -131,75 +145,81 @@
 		Log.finest("Restarting " + this.engines.size() + " " + this.getEnginesDescription() + " engine(s)."); //$NON-NLS-1$
 		return stopEngines() && startEngines(null);
 	}
-	
+
 	/**
 	 * Gets the engine type that this manager supports.
+	 * 
 	 * @return the engine type that this manager supports
 	 */
 	public abstract EngineType getEnginesType();
-	
-	
+
 	/**
 	 * Gets the engine description that this manager supports.
+	 * 
 	 * @return the engine description that this manager supports
 	 */
-	public String getEnginesDescription()	{
+	public String getEnginesDescription() {
 		return this.getEnginesType().getDescription();
 	}
-	
-	
+
 	/**
-	 * Gets the available engines. 
+	 * Gets the available engines.
+	 * 
 	 * @return the available engines
 	 */
 	public HashMap<String, T> getEngines() {
 		return engines;
 	}
-	
+
 	/**
 	 * Gets an engine specified by its name.
+	 * 
 	 * @param name
 	 * @return an engine specified by its name if exists, otherwise null
 	 */
 	public T getEngine(String name) {
 		return engines.get(name);
 	}
-	
+
 	/**
 	 * Returns the current engine.
+	 * 
 	 * @return
 	 */
 	public T getCurrentEngine() {
 		return this.currentEngine;
 	}
-	
-	
+
 	/**
 	 * Sets the current engine.
+	 * 
 	 * @param engine
 	 */
-	public void setCurrentEngine(T engine)	{
+	public void setCurrentEngine(T engine) {
 		Log.info("Setting current " + this.getEnginesDescription() + " engine to " + engine + ".");
 		this.currentEngine = engine;
 	}
-	
+
 	/**
 	 * Sets the current engine specified by its name.
+	 * 
 	 * @param name
 	 */
-	public void setCurrentEngine(String name)	{
+	public void setCurrentEngine(String name) {
 		this.setCurrentEngine(this.getEngine(name));
 	}
-	
+
 	/**
 	 * Gets an installed engine according to its class type.
+	 * 
 	 * @param classType
-	 * @return the installed engine according to its class type if it exists otherwise null
+	 * @return the installed engine according to its class type if it exists
+	 *         otherwise null
 	 */
-	public T getEngine(Class classType)	{
+	public T getEngine(Class classType) {
 		T engine = null;
 		for (T engine2 : this.engines.values()) {
-			if(engine2.getClass().equals(classType))	{
+			if (engine2.getClass().equals(classType)) {
 				engine = engine2;
 				break;
 			}
Index: tmp/org.txm.core/src/java/org/txm/core/preferences/TXMPreferences.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/core/preferences/TXMPreferences.java	(revision 880)
+++ tmp/org.txm.core/src/java/org/txm/core/preferences/TXMPreferences.java	(revision 881)
@@ -145,6 +145,8 @@
 	 * Separator used when converting list from and to string.
 	 */
 	public static final String LIST_SEPARATOR =  "\t"; //$NON-NLS-1$
+
+	public static final String MATCHES = "matches";
 	
 	
 	
Index: tmp/org.txm.core/src/java/org/txm/importer/ValidateXml.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/ValidateXml.java	(revision 880)
+++ tmp/org.txm.core/src/java/org/txm/importer/ValidateXml.java	(revision 881)
@@ -51,24 +51,21 @@
 public class ValidateXml {
 
 	/**
-	 * @throws XMLStreamException 
-	 * test a String, not implemented.
+	 * @throws XMLStreamException test a String, not implemented.
 	 *
-	 * @param xmldata the xmldata
-	 * @return true, if successful
-	 * @throws  
+	 * @param xmldata the xmldata @return true, if successful @throws
 	 */
 	public static boolean testAndThrow(File infile) throws XMLStreamException {
 		if (infile.isDirectory()) {
-			System.out.println( TXMCoreMessages.ValidateXml_0+infile+TXMCoreMessages.ValidateXml_1);
+			System.out.println(TXMCoreMessages.ValidateXml_0 + infile + TXMCoreMessages.ValidateXml_1);
 			return false;
 		}
 		if (!infile.exists()) {
-			System.out.println( TXMCoreMessages.ValidateXml_0+infile+TXMCoreMessages.ValidateXml_2);
+			System.out.println(TXMCoreMessages.ValidateXml_0 + infile + TXMCoreMessages.ValidateXml_2);
 			return false;
 		}
 		if (!infile.canRead()) {
-			System.out.println(TXMCoreMessages.ValidateXml_0+infile+TXMCoreMessages.ValidateXml_3);
+			System.out.println(TXMCoreMessages.ValidateXml_0 + infile + TXMCoreMessages.ValidateXml_3);
 			return false;
 		}
 		try {
@@ -76,8 +73,7 @@
 			InputStream inputData = url.openStream();
 			XMLInputFactory factory = XMLInputFactory.newInstance();
 			XMLStreamReader parser = factory.createXMLStreamReader(inputData);
-			for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser
-					.next()) {
+			for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
 
 			}
 			parser.close();
@@ -93,20 +89,22 @@
 	/**
 	 * test a content stored in a String, not implemented.
 	 *
-	 * @param xmldata the xmldata
+	 * @param xmldata
+	 *            the xmldata
 	 * @return true, if successful
 	 */
-	public static boolean test(String xmldata){
+	public static boolean test(String xmldata) {
 		return testAndGetError(xmldata).length() == 0;
 	}
-	
+
 	/**
 	 * test a content stored in a String, not implemented.
 	 *
-	 * @param xmldata the xmldata
+	 * @param xmldata
+	 *            the xmldata
 	 * @return true, if successful
 	 */
-	public static String testAndGetError(String xmldata){
+	public static String testAndGetError(String xmldata) {
 		try {
 			Node records = new XmlParser().parseText(xmldata);
 			return "";
@@ -119,20 +117,21 @@
 	/**
 	 * test a file.
 	 *
-	 * @param infile the infile
+	 * @param infile
+	 *            the infile
 	 * @return false if the file is not valid
 	 */
 	public static boolean test(File infile) {
 		if (infile.isDirectory()) {
-			System.out.println( TXMCoreMessages.ValidateXml_0+infile+TXMCoreMessages.ValidateXml_1);
+			System.out.println(TXMCoreMessages.ValidateXml_0 + infile + TXMCoreMessages.ValidateXml_1);
 			return false;
 		}
 		if (!infile.exists()) {
-			System.out.println( TXMCoreMessages.ValidateXml_0+infile+TXMCoreMessages.ValidateXml_2);
+			System.out.println(TXMCoreMessages.ValidateXml_0 + infile + TXMCoreMessages.ValidateXml_2);
 			return false;
 		}
 		if (!infile.canRead()) {
-			System.out.println(TXMCoreMessages.ValidateXml_0+infile+TXMCoreMessages.ValidateXml_3);
+			System.out.println(TXMCoreMessages.ValidateXml_0 + infile + TXMCoreMessages.ValidateXml_3);
 			return false;
 		}
 		try {
@@ -140,8 +139,7 @@
 			InputStream inputData = url.openStream();
 			XMLInputFactory factory = XMLInputFactory.newInstance();
 			XMLStreamReader parser = factory.createXMLStreamReader(inputData);
-			for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser
-					.next()) {
+			for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
 
 			}
 			parser.close();
@@ -156,11 +154,11 @@
 	/**
 	 * The main method.
 	 *
-	 * @param args the arguments
+	 * @param args
+	 *            the arguments
 	 */
 	public static void main(String[] args) {
-		if (ValidateXml.test(new File(
-				"~/TXM/corpora/discours/txm/01_DeGaulle.xml"))) //$NON-NLS-1$
+		if (ValidateXml.test(new File("~/TXM/corpora/discours/txm/01_DeGaulle.xml"))) //$NON-NLS-1$
 			System.out.println("OK"); //$NON-NLS-1$
 		else
 			System.out.println("ERROR"); //$NON-NLS-1$
Index: tmp/org.txm.core/src/java/org/txm/importer/Factiva2XmlTxm.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/Factiva2XmlTxm.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/Factiva2XmlTxm.groovy	(revision 881)
@@ -0,0 +1,261 @@
+/**
+ * Main.
+ *
+ * @param args the args
+ */
+// script de recherche de contenus entre balises dans un fichier xml
+
+/**
+ *  @author Daniel Marin, Florent Bédécarrats
+ *  @author Matthieu Decorde
+ *  @copyright 2011 Daniel Marin &  Florent Bédécarrats, for original Perl version
+ *  @copyright 2011 ENS de Lyon, for translation in Groovy
+ *  This software is licensed under the GNU GPL version 3.0 or later. 
+ */
+package org.txm.importer;
+
+public run(File rootDir, String rep_final ) {
+
+	// A RENSEIGNER #########################################
+	
+	def fich_xml = rootDir.listFiles().grep(~/.*\.xml/)
+	println "$rootDir : $fich_xml"
+
+	def ext = ".xml"
+	//def rep_final = rootDir.getAbsolutePath()+"/out" // le nom du répertoire dans lequel on va créer les fichiers txm
+
+	List<String> Balises = ["<baseLanguage>","<date>","<sourceName>","<name>","<name>"] // balises XML à détecter
+	List<String> FinBalises = ["</baseLanguage>","</date>","</sourceName>","</name>","</name>"]
+
+	List<String> Sections = ["<ppsarticle>","<industry ","<region ","<headline>","<tailParagraphs>"] // Balises indiquant qu'à 'intérieur de la section se trouvent les infos (sur plusieurs lignes contrairement à @Balises)
+	List<String> FinSections = ["</ppsarticle>","</industry>","</region>","</headline>","</tailParagraphs>"]
+
+	def Headline = [] // le tableau dans lequel on va stocker le contenu de <headline>
+	def TailPara = [] // le tableau dans lequel on va stocker le contenu de <tailParagraphs>
+
+	def NomsMeta = ["language=","date=","source=","subject=","country="] // les noms qui interviennent dans les méta-données du fichier final
+	// FIN A RENSEIGNER #####################################
+
+	def TestMeta = [0,0,0,0,0] // Tableau qui indique si les métadonnées sont disponibles dans le fichier
+	def MetaData = [] //le tableau des metadonnées
+	def metaData = "" // la chaine dans laquelle on va stocker les métadonnées
+	String temp = ""
+	def fich_out = ">"
+	def nom_in = ""
+
+	def new_fich=0 // variable booleenne qui indique si on doit créer un nouveau txm
+	def industry=0 // variable booleenne qui indique qu'on est dans la section <industry> pour renseigner "subject"
+	def premIndustry=0 // variable booleenne qui indique qu'on a passé le 1er <industry> pour renseigner "subject"
+	def region=0 // variable booleenne qui indique qu'on est dans la section <region> pour renseigner "country"
+	def premRegion=0 // variable booleenne qui indique qu'on a passé le 1er <region> pour renseigner "country"
+	def copie=0 // variable booleenne qui indique si l'on doit copier le contenu de la ligne dans le fichier txm
+	def copieSec3=0 // variable qui indique si on est à l'intérieur de la section 3
+	def copieSec4=0 // variable qui indique si on est à l'intérieur de la section 4
+
+	def num_fich=0 // le numéro du fichier traité
+	def char_num_fich="" // pour numéroter les fichiers fich_001 pour garder l'ordre alphabétique
+
+	def i = 1
+
+	println "Création du répertoire dans lequel on va mettre les fichiers finaux txm"
+	if (new File(rep_final).exists()) {
+		println "Le répertoire $rep_final existe"
+	}
+	else {
+		if (!new File(rep_final).mkdir()) {
+			println "Echec de la création du répertoire: $rep_final"
+			return
+		}
+		if (!new File(rep_final).canWrite()) {
+			println "Le répertoire '$rep_final' final est read-only"
+			return
+		}
+	}
+
+	FileWriter ECRITURE
+	for (File fich_in : fich_xml) {
+		if (fich_in.getName() == "import.xml") continue;
+		println "Validate $fich_in...";
+		if (!ValidateXml.test(fich_in)) {
+			println "skip $fich_in"
+			continue;
+		}
+		// open(LECTURE, fich_in) || die("erreur d'ouverture de $fich_in")
+		println "on parcourt l'ensemble de $fich_in"
+		def reader = new FileReader(fich_in)
+		String line = reader.readLine()
+		while (line != null)
+		{
+			// on stocke le contenu de la ligne (et on efface le retour chariot à la fin)
+			temp = line
+			temp = temp.trim()
+			temp = (temp =~ /^\s+/).replaceAll("")
+			temp = (temp =~ /^\t/).replaceAll("")
+			temp = temp.replaceAll("</paragraph>", "</paragraph><br/>")
+
+			// On indique si on est dans la 1ère section de industry ou region pour prélever <name>
+			if ((temp =~ Sections[1]) && (premIndustry==0)){
+				industry=1
+				premIndustry=1
+			}
+			else if (temp =~ FinSections[1]){
+				industry=0
+			}
+
+			if ((temp =~ Sections[2]) && (premRegion==0)){
+				region = 1
+				premRegion = 1
+			}
+			else if (temp =~ FinSections[2]){
+				region = 0
+			}
+
+			// on regarde si la balise de création de nouveau fichier est présente
+			if (temp =~ Sections[0]){
+				new_fich=1
+				num_fich = num_fich+1
+				nom_in = fich_in.getName()
+				nom_in = (nom_in =~ /$ext/).replaceAll("")
+				// Petit test pour numéroter les fichiers en 001, 002 plutôt que 1, 2 (ordre alphabétique)
+				if (num_fich < 10){
+					char_num_fich = "00"+num_fich
+				} else if (num_fich<100) {
+					char_num_fich = "0"+num_fich
+				} else {
+					char_num_fich = num_fich
+				}
+				fich_out = new File(rep_final, nom_in + "_" + char_num_fich + ext)
+				//open(ECRITURE,"> $fich_out") || die("erreur d'ouverture de $fich_out ! $! \n")
+				println("new file : "+fich_out)
+				if (ECRITURE != null) ECRITURE.close()
+				ECRITURE = new FileWriter(fich_out)
+			}
+
+			// Remplissage des métadonnées : ####################################################
+			// Language
+			if (temp =~ Balises[0]){
+				temp = (temp =~ Balises[0]).replaceAll("")
+				temp = (temp =~ FinBalises[0]).replaceAll("")
+
+				MetaData[0]=temp
+				print " language trouve : "+MetaData[0]+" \n"
+				TestMeta[0]=1
+
+			}
+			// date
+			if (temp =~ Balises[1]) {
+				temp = (temp =~ Balises[1]).replaceAll("")
+				temp = (temp =~ FinBalises[1]).replaceAll("")
+				MetaData[1]=temp
+				print " date trouvee : "+MetaData[1]+" \n"
+				TestMeta[1]=1
+			}
+			// source
+			if (temp =~ Balises[2]){
+				temp = (temp =~ Balises[2]).replaceAll("")
+				temp = (temp =~ FinBalises[2]).replaceAll("")
+				MetaData[2]=temp
+				print " source trouvee : "+MetaData[2]+" \n"
+				TestMeta[2]=1
+			}
+			// subject (on doit être dans la 1ère section <industry>)
+			if ((temp =~ Balises[3]) && (industry==1)){
+				temp = (temp =~ Balises[3]).replaceAll("")
+				temp = (temp =~ FinBalises[3]).replaceAll("")
+				MetaData[3]=temp
+				industry=0
+				print " Sujet trouve : "+MetaData[3]+" \n"
+				TestMeta[3]=1
+			}
+			// country
+			if ((temp =~ Balises[4]) && (region==1)){
+				temp = (temp =~ Balises[4]).replaceAll("")
+				temp = (temp =~ FinBalises[4]).replaceAll("")
+				MetaData[4]=temp
+				region=0
+				print " Pays trouve : "+MetaData[4]+" \n"
+				TestMeta[4]=1
+
+				// Toutes les méta-données ont été trouvées, on assemble la chaîne
+				metaData = "<article "
+				for (i=0;i<(NomsMeta.size()+1);i++){
+					if (TestMeta[i]==1){
+						metaData = metaData+NomsMeta[i]+"\""+MetaData[i]+"\" "
+					}
+					else if (TestMeta[i]==0){
+						metaData = metaData +NomsMeta[i]+"\"\" "
+					}
+				}
+				metaData = "$metaData>\n"
+				print " metaData : $metaData \n"
+			}
+			// FIN Remplissage des métadonnées : #################################################
+
+			// On copie ou pas si on est ou pas dans <headline> ou <tailParagraphs>
+			if (temp =~ Sections[3]){
+				copieSec3=1
+			}
+			if (temp =~ FinSections[3]){
+				Headline.add(temp)
+				copieSec3=0
+			}
+			if (temp =~ Sections[4]){
+				copieSec4=1
+			}
+			if (temp =~ FinSections[4]){
+				TailPara.add(temp)
+				copieSec4=0
+			}
+
+			if (copieSec3 == 1){
+				Headline.add(temp)
+			}
+			if (copieSec4 == 1){
+				TailPara.add(temp)
+			}
+
+			if (temp =~ FinSections[0]){
+				ECRITURE.write("$metaData\n")
+				for (i=0;i<(Headline.size());i++){
+					if (i==0 || i==Headline){
+						ECRITURE.write(Headline[i].toString()+"\n")
+					}
+					else{
+						ECRITURE.write("\t"+Headline[i]+"\n")
+					}
+				}
+				for (i=0;i<(TailPara.size());i++){
+					if (i==0 || i==TailPara){
+						ECRITURE.write(TailPara[i].toString()+"\n")
+					}
+					else{
+						ECRITURE.write("\t"+TailPara[i]+"\n")
+					}
+				}
+				ECRITURE.write("</article>")
+
+				new_fich=0
+				industry=0
+				region=0
+				premIndustry=0
+				premRegion=0
+				MetaData=[]
+				TestMeta=[0,0,0,0,0]
+				Headline=[]
+				TailPara=[]
+
+				ECRITURE.close()
+				print "fichier $char_num_fich traite.\n"
+			}
+			line = reader.readLine()
+		}
+		ECRITURE.close()
+		reader.close()
+		num_fich = 0
+	}
+}
+
+String userDir = System.getProperty("user.home");
+File rootDir = new File(userDir, "xml/factiva")
+File outdir = new File(rootDir, "out2")
+run(rootDir, outdir.getAbsolutePath());
\ No newline at end of file
Index: tmp/org.txm.core/src/java/org/txm/importer/WordCounter.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/WordCounter.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/WordCounter.groovy	(revision 881)
@@ -0,0 +1,189 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 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: 2015-12-17 12:11:39 +0100 (jeu. 17 déc. 2015) $
+// $LastChangedRevision: 3087 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer;
+
+import java.io.BufferedReader;
+import java.util.ArrayList;
+import javax.xml.parsers.SAXParserFactory
+import org.xml.sax.helpers.DefaultHandler
+import org.xml.sax.*
+import javax.xml.stream.*;
+import java.net.URL;
+
+// TODO: Auto-generated Javadoc
+/** Count the focused tag and add id to it you must specify  : which tag are milestones the tag to count. */
+class WordCounter extends DefaultHandler {
+    String txt ;
+	
+	/** The focus. */
+	String focus;
+    
+    /** The counter. */
+    int counter = 0;
+    
+    /** The solotags. */
+    ArrayList<String> solotags;
+    
+    /** The writer. */
+    XMLStreamWriter writer;
+	
+	/**
+	 * The initializer do the work
+	 * The file infile is replaced by the result.
+	 *
+	 * @param infile the infile
+	 * @param focus the focus
+	 * @param txt the txt
+	 */
+    WordCounter(File infile, String focus, String txt)
+    {
+    	File outfile = new File(infile.getName()+"counter");
+		this.focus=focus;
+		this.txt = txt;
+		
+		FileInputStream input = new FileInputStream(infile);
+		
+        def handler = this;
+        def reader = SAXParserFactory.newInstance().newSAXParser();
+		
+        def output = new FileOutputStream(outfile);
+        XMLOutputFactory factory = XMLOutputFactory.newInstance();
+		writer = factory.createXMLStreamWriter(output, "UTF-8");
+		writer.writeStartDocument("UTF-8", "1.0");
+		output.write("\n")
+		
+		//Reader inputStream = new InputStreamReader(new FileInputStream(infile) , "UTF-8");
+		//BufferedReader r= new BufferedReader(inputStream);
+		
+        reader.parse(input, handler);// process !!
+		
+        input.close();
+        writer.close();
+		output.close();
+        //r.close();
+        if (!(infile.delete() && outfile.renameTo(infile))) println "Warning can't rename file "+outfile+" to "+infile
+    }
+	
+	/**
+	 * process start tag.
+	 *
+	 * @param ns the ns
+	 * @param localName the localname of the current tag
+	 * @param qName the q name
+	 * @param atts the attributes of the current tag
+	 */
+    void startElement(String ns, String localName, String qName, Attributes atts) {
+    	
+    	writer.writeStartElement(qName)
+    	
+    	//writeAttrs
+        if(qName.matches(focus))
+        {
+        	counter++;
+        	writer.writeAttribute("n",""+counter)
+            writer.writeAttribute("xml:id",focus+txt+"_"+counter)
+            for(int i=0; i < atts.getLength();i++)
+            	if(atts.getQName(i) != "n" && atts.getQName(i) != "xml:id" && atts.getQName(i) != "id")
+                writer.writeAttribute(atts.getQName(i), atts.getValue(i));
+        }
+        else
+        {
+        	for(int i=0; i < atts.getLength();i++)
+                writer.writeAttribute(atts.getQName(i), atts.getValue(i));
+        }
+    }
+	
+	/**
+	 * write the CDATA, not finished.
+	 *
+	 * @param chars all the chars
+	 * @param offset where the text begin
+	 * @param length the length
+	 */
+    void characters(char[] chars, int offset, int length)
+    {
+    	writer.writeCharacters(chars, offset, length)
+    }
+	
+	/* (non-Javadoc)
+	 * @see org.xml.sax.helpers.DefaultHandler#endElement(java.lang.String, java.lang.String, java.lang.String)
+	 */
+    void endElement(String ns, String localName, String qName)
+    {
+       writer.writeEndElement();
+    }
+    
+    /**
+     * Find text id.
+     *
+     * @param infile the infile
+     * @param focus the focus
+     * @return the string
+     */
+    public static String findTextId(File infile, String focus)
+    {
+    	def inputData = infile.toURI().toURL().openStream();
+		def inputfactory = XMLInputFactory.newInstance();
+		XMLStreamReader parser = inputfactory.createXMLStreamReader(inputData);
+				
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) 
+		{
+			switch (event) 
+			{
+				case XMLStreamConstants.START_ELEMENT:
+					if(parser.getLocalName() == focus)
+					{
+						String sid = ""
+						for(int i = 0 ; i < parser.getAttributeCount() ; i++)
+							if(parser.getAttributeLocalName(i) == "id")
+							{
+								sid = parser.getAttributeValue(i); //xxx_000
+								sid = sid.substring(focus.length()); // on retire le nom du focus
+								sid = sid.split("_")[0];
+								break;
+							}
+						inputData.close();
+						parser.close();
+						return sid;
+					}
+			}
+		}
+    }
+    
+    /**
+     * The main method.
+     *
+     * @param args the arguments
+     */
+    static void main(String[] args)
+    {
+    	File infile = new File("~/xml/quote/processme-q.xml")
+        new WordCounter(infile, "s","01");
+    	new WordCounter(infile, "q","01");
+    }
+}
\ No newline at end of file
Index: tmp/org.txm.core/src/java/org/txm/importer/ApplyXsl.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/ApplyXsl.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/ApplyXsl.groovy	(revision 881)
@@ -0,0 +1,243 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 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.
+
+//
+// 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: 2016-03-01 10:10:58 +0100 (mar. 01 mars 2016) $
+// $LastChangedRevision: 3133 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer;
+
+/**
+ * @author mdecorde
+ */
+
+import java.io.File;
+import javax.xml.transform.Transformer
+import javax.xml.transform.TransformerFactory
+import javax.xml.transform.stream.StreamResult
+import javax.xml.transform.stream.StreamSource;
+
+import net.sf.saxon.*;
+import net.sf.saxon.s9api.*;
+
+// 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 ApplyXsl {
+	
+//	/** 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;
+
+	TransformerFactory tFactory;
+	Transformer transformer;
+	
+	/**
+	 * initialize with the xslt file.
+	 *
+	 * @param xsltfile the xsltfile
+	 */
+	public ApplyXsl(String xsltfile) {
+//		proc = new Processor(false);
+//		comp = proc.newXsltCompiler();
+//		exp = comp.compile(new StreamSource(new File(xsltfile)));
+		tFactory = new net.sf.saxon.TransformerFactoryImpl();
+		transformer = tFactory.newTransformer(new StreamSource(xsltfile));
+
+	}
+	
+	/**
+	 * initialize with the xslt file.
+	 *
+	 * @param xsltfile the xsltfile
+	 */
+	public ApplyXsl(File xsltfile) {
+//		proc = new Processor(false);
+//		comp = proc.newXsltCompiler();
+//		exp = comp.compile(new StreamSource(xsltfile));
+		tFactory = new net.sf.saxon.TransformerFactoryImpl();
+		transformer = tFactory.newTransformer(new StreamSource(xsltfile));
+	}
+
+	/**
+	 * Set in and out file.
+	 *
+	 * @param xmlinfile the xmlinfile
+	 * @param xmloutfile the xmloutfile
+	 * @return true, if successful
+	 */
+	private boolean SetInOutSource(String xmlinfile, String xmloutfile) {
+//		if (proc == null || exp == null || comp == null)
+//			return false;
+//
+//		source = proc.newDocumentBuilder().build(
+//				new StreamSource(new File(xmlinfile)));
+//		out = new Serializer();
+//		out.setOutputFile(new File(xmloutfile));
+//
+//		trans = exp.load();
+//		transformer.set.setInitialContextNode(source);
+//		transformer.setDestination(out);
+		return true;
+	}
+
+	/**
+	 * Set a xslt param.
+	 *
+	 * @param name the name
+	 * @param value the value
+	 * @return true, if successful
+	 */
+	public boolean SetParam(String name, Object value) {
+//		if (trans != null)
+//			trans.setParameter(new QName(name), new XdmAtomicValue("" + value));
+//		else
+//			return false;
+		return true;
+	}
+
+	/**
+	 * Force java to clean memory after processing a xslt. If not we might catch
+	 * a JavaHeapspace Exception
+	 * 
+	 */
+	private void cleanMemory() {
+//		source = null;
+//		trans = null;
+//		out = null;
+	}
+
+	/**
+	 * 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
+	 */
+
+	public boolean process(String xmlinfile, String xmloutfile, String[] args) {
+		if (!this.SetInOutSource(xmlinfile, xmloutfile))
+			return false;
+		for (int i = 0; i < args.length; i = i + 2)// set params
+		{
+			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
+	 * @return true, if successful
+	 */
+	public boolean process(String xmlinfile, String xmloutfile) {
+		if (!this.SetInOutSource(xmlinfile, xmloutfile))
+			return false;
+
+		transformer.transform(new StreamSource(xmlinfile), new StreamResult(new BufferedOutputStream(new FileOutputStream(xmloutfile))));
+		cleanMemory();
+		// System.out.println("Done");
+		return true;
+	}
+
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		String xslfile = "pathtoxslfile";
+		ApplyXsl a = new ApplyXsl(xslfile);
+		
+		File srcdirectory = new File("pathtodirectorytoprocess")
+		assert(srcdirectory.exists())
+		assert(srcdirectory.isDirectory())
+		assert(srcdirectory.canRead())
+		assert(srcdirectory.canExecute())
+		
+		List<File> files = srcdirectory.listFiles();
+		
+		files = files.findAll{item-> item.getName().endsWith(".xml")}
+		
+		long bigstart = System.currentTimeMillis()
+		for(File infile : files)
+		{
+			String outfile = infile.getAbsolutePath()+".out"
+			if(infile.canRead())
+			{
+				long start = System.currentTimeMillis()
+				println "Process : "+infile.getName()
+				// String[] params = ["pbval1",1,"pbval2",2];
+				// a.process(infile.getAbsolutePath(),outfile); // no parameters
+				// a.process( infile.getAbsolutePath(),outfile,params);
+				println "Done : "+(System.currentTimeMillis()-start)+"ms"
+			}
+		}
+		println "Total time : "+(System.currentTimeMillis()-bigstart)+"ms"
+	}
+}
Index: tmp/org.txm.core/src/java/org/txm/importer/CopyXMLFiles.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/CopyXMLFiles.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/CopyXMLFiles.groovy	(revision 881)
@@ -0,0 +1,61 @@
+package org.txm.importer;
+
+import java.io.File;
+import java.io.InputStream;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLResolver;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.events.DTD;
+import javax.xml.stream.events.EntityReference;
+import org.txm.utils.*
+
+public class CopyXMLFiles {
+	File xmlFile;
+	File outDir;
+	def dtdFiles = []
+	
+	public CopyXMLFiles(File xmlFile) {
+		this.xmlFile = xmlFile;
+	}
+	
+	public boolean copy(File outDir) {
+		XMLInputFactory factory;
+		XMLStreamReader parser;
+		InputStream inputData = xmlFile.toURI().toURL().openStream();
+		factory = XMLInputFactory.newInstance();
+		factory.setXMLResolver(new XMLResolver() {
+			@Override
+			public Object resolveEntity(String publicID, String systemID,
+					String baseURI, String namespace) throws XMLStreamException {
+				//println "Resolving $publicID $systemID $baseURI $namespace"
+				File srcFile = new File(xmlFile.getParentFile(), systemID);
+				dtdFiles << srcFile
+				return srcFile.toURI().toURL().openStream();
+			}
+		});
+	
+		parser = factory.createXMLStreamReader(inputData);
+		
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			
+		}
+		
+		dtdFiles << xmlFile
+		for (File dtd : dtdFiles) {
+			File cpy = new File(outDir, dtd.getName());
+			FileCopy.copy(dtd, cpy);
+		}
+		return outDir.listFiles().size() == dtdFiles.size();
+	}
+	
+	public static void main(def args) {
+		File xmlFile = new File("/home/mdecorde/Téléchargements/Inscriptions1.xml")
+		File outDir = new File("/home/mdecorde/Téléchargements/test")
+		outDir.mkdir()
+		CopyXMLFiles cdf = new CopyXMLFiles(xmlFile)
+		println cdf.copy(outDir)
+	}
+}
Index: tmp/org.txm.core/src/java/org/txm/importer/FortranColumns2XML.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/FortranColumns2XML.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/FortranColumns2XML.groovy	(revision 881)
@@ -0,0 +1,325 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 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.
+
+//
+// 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: 2017-04-11 15:30:35 +0200 (mar. 11 avril 2017) $
+// $LastChangedRevision: 3426 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer;
+
+import org.txm.utils.i18n.DetectBOM;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStreamReader;
+
+import javax.xml.stream.*;
+import java.net.URL;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class FortranColumns2XML.
+ */
+class FortranColumns2XML {
+	
+	/** The infile. */
+	
+	File infile;
+	
+	/** The outfile. */
+	File outfile;
+	
+	/** The encoding. */
+	String encoding;
+	
+	/** The column names. */
+	List<String> columnNames
+	
+	/** The word tag. */
+	String wordTag;
+	
+	/** The wordcolumn. */
+	int wordcolumn;
+	
+	/** The linecounter. */
+	int linecounter = 0;
+	
+	/** The check line number. */
+	int checkLineNumber;
+	
+	/** The check line number tag. */
+	String checkLineNumberTag;
+	
+	/** The columnindex. */
+	private List<Integer> columnindex;
+	
+	/** The endcolumnindex. */
+	private List<Integer> endcolumnindex;
+	
+	/** The line. */
+	private String line;
+	
+	/** The writer. */
+	private XMLStreamWriter writer;
+	
+	/** The reader. */
+	private Reader reader;
+	
+	/** The output. */
+	private FileOutputStream output;
+	
+	String textname;
+	
+	/**
+	 * Instantiates a new fortran columns2 xml.
+	 *
+	 * @param infile the infile
+	 * @param outfile the outfile
+	 * @param encoding the encoding
+	 */
+	FortranColumns2XML(File infile, File outfile, String encoding)
+	{
+		this.infile = infile;
+		this.outfile = outfile;
+		
+		textname = infile.getName();
+		int idx = -1;
+		idx = textname.lastIndexOf(".");
+		if (idx > 0)
+			textname = textname.substring(0, idx);
+
+		def input = new FileInputStream(infile) 		
+		reader = new InputStreamReader(input , encoding);
+		DetectBOM bomdetector = new DetectBOM(infile);
+		for (int ibom = 0 ; ibom < bomdetector.getBOMSize() ; ibom++) input.read()
+		
+		XMLOutputFactory factory = XMLOutputFactory.newInstance();
+		output = new FileOutputStream(outfile)
+		writer = factory.createXMLStreamWriter(output, "UTF-8");
+	}
+	
+	/**
+	 * Process.
+	 *
+	 * @return true, if successful
+	 */
+	public boolean process()
+	{
+		line = reader.readLine(); // use the first line to find columns 
+		
+		if(columnindex == null || endcolumnindex == null)
+		{
+			searchNumberOfColumns();
+		}
+		
+		if(columnindex.size() != columnNames.size())
+		{
+			System.err.println("Number of column("+columnindex.size()+") different of number of column name("+columnNames.size()+")");
+			return false;
+		}
+		
+		//write start document
+		writer.writeStartDocument("UTF-8", "1.0");
+		writer.writeStartElement("text")
+		writer.writeAttribute("id",infile.getName())
+		
+		boolean gogogo = true;
+		while(gogogo)
+		{	
+			//println "line : "+line
+			processLine();//split line accordinly to columnindexes
+			linecounter++;
+			
+			//continue to read the document
+			line = reader.readLine();
+			if(line == null)
+				gogogo= false;
+		}
+		
+		writer.writeEndElement();
+		writer.writeEndDocument();
+		writer.close();
+		output.close();
+		
+		return true;
+	}
+	
+	/**
+	 * Process line.
+	 */
+	int wordcount = 1;
+	private void processLine()
+	{
+		String pcdata;
+		if(line.length() > 0)
+		{
+			writer.writeStartElement(wordTag)
+			if(setIds)
+				writer.writeAttribute("id", "w_"+textname+"_"+(wordcount++));
+			for(int i = 0 ; i < columnindex.size(); i++)
+			{
+				if(line.length() > endcolumnindex.get(i))
+				{
+					String substring = line.substring(columnindex.get(i), endcolumnindex.get(i))
+					if(i != wordcolumn)
+					{
+						writer.writeAttribute(columnNames.get(i), substring.trim())
+					}
+					else
+					{
+						pcdata = substring.trim()
+					}
+				}
+				else
+				{
+					println "Error: line $linecounter: len="+line.length()+" maxidx="+endcolumnindex.get(i)
+					println line;
+				}
+			}
+			writer.writeCharacters(pcdata);
+			writer.writeEndElement();
+		}
+	}
+	
+	/**
+	 * Sets the column indexes.
+	 *
+	 * @param starts the starts
+	 * @param ends the ends
+	 */
+	private void setColumnIndexes(List<Integer> starts, List<Integer> ends)
+	{
+		columnindex = starts;
+		endcolumnindex = ends;
+	}
+	
+	boolean setIds = false;
+	public void setAddIds(boolean setIds)
+	{
+		this.setIds = setIds;
+	}
+	
+	/**
+	 * Search number of columns.
+	 */
+	private void searchNumberOfColumns()
+	{
+		columnindex = new ArrayList<Integer>();
+		endcolumnindex = new ArrayList<Integer>();
+		columnindex.add(0);
+		int ic = 0
+		char c;
+		char[] cline = line.toCharArray();
+		int state = 0; // 0 lettre, 1 espace
+		
+		for(ic = 0 ; ic < cline.length ; ic++)
+		{
+			c = cline[ic];
+			if(state == 0)// zone lettre
+			{
+				if(c == " ")
+				{
+					state = 1;
+					
+				}
+			}
+			else // zone espace
+			{
+				if(c != " ")
+				{
+					columnindex.add(ic);
+					endcolumnindex.add(ic-1);
+					state = 0;
+				}
+			}
+		}
+		endcolumnindex.add(cline.length);
+		println columnindex;
+		println endcolumnindex;
+	}
+	
+	/**
+	 * Sets the columns lines names.
+	 *
+	 * @param columnNames the column names
+	 * @param unitTag the unit tag
+	 * @param wordcolumn the wordcolumn
+	 */
+	public void setColumnsLinesNames(List<String> columnNames, String unitTag, int wordcolumn)
+	{
+		this.columnNames = columnNames;
+		this.wordTag = unitTag;
+		this.wordcolumn = wordcolumn;
+	}
+	
+	/**
+	 * Sets the line check.
+	 *
+	 * @param colindex the colindex
+	 * @param tagname the tagname
+	 */
+	public void setLineCheck(int colindex, String tagname)
+	{
+		this.checkLineNumber = colindex;
+		this.checkLineNumberTag = tagname;
+	}
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		File fortranfile = new File(System.getProperty("user.home"),"\\xml\\lasla\\lasla\\L01PlaAmphi.APN");
+		File outfile = new File(System.getProperty("user.home"),"\\xml\\lasla\\out.xml");
+		FortranColumns2XML builder = new FortranColumns2XML(fortranfile, outfile, "iso-8859-1");
+		builder.setColumnIndexes([0, 3, 4, 8, 29, 55, 67],	[3, 4, 8, 28, 54, 66, 79]);
+		builder.setColumnsLinesNames(["ref","s","sent","word","lemme","line","pos"], "w", 3);
+		builder.setLineCheck(3, "l");
+		
+		builder.process();
+	}
+}
+
+
Index: tmp/org.txm.core/src/java/org/txm/importer/CsvToXml.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/CsvToXml.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/CsvToXml.groovy	(revision 881)
@@ -0,0 +1,185 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 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: 2015-12-17 12:11:39 +0100 (jeu. 17 déc. 2015) $
+// $LastChangedRevision: 3087 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer
+
+import java.io.FileInputStream
+import java.io.InputStreamReader
+import java.nio.charset.Charset
+import org.txm.utils.*
+
+import javax.xml.stream.*
+import java.net.URL
+
+/**
+ * The Class CsvToXml: allow to convert CSV files to XML files
+ *
+ * @author mdecorde
+ */
+class CsvToXml {
+
+	/** The titles. */
+	File xmlfile
+	List<String> titles = []
+
+	private CsvReader getCSVReader(File csvfile, String fieldSeparator, String encoding) {
+		CsvReader csvreader = new CsvReader(csvfile.getAbsolutePath(), fieldSeparator.charAt(0), Charset.forName(encoding))
+
+		//get titles
+		csvreader.readHeaders()
+		titles = []
+		for (String title : csvreader.getHeaders()) {
+			titles << title
+		}
+
+		if (titles.size() == 0) {
+			println "the CSV file as no column"
+			return null
+		}
+
+		if (titles.contains("text") == 0) {
+			println "the CSV file as no 'text' column"
+			return null
+		}
+
+		if (titles.contains("id") == 0) {
+			println "the CSV file as no 'id' column"
+			return null
+		}
+		
+		return csvreader
+	}
+	
+	/**
+	 * Convert a CSV file to ONE XML file using the first line to declare metadata
+	 *
+	 * @param csvfile the csvfile
+	 * @param outfile the outfile
+	 * @param fieldSeparator the field separator
+	 * @param textSeparator the text separator
+	 * @param encoding the encoding
+	 * @return true, if successful
+	 */
+	public boolean toOneXMLFile(File csvfile, File xmlfile, String fieldSeparator, String textSeparator, String encoding) {
+		CsvReader csvreader = getCSVReader(csvfile, fieldSeparator, encoding)
+		if (csvreader == null) return false
+		
+		println "Metadata properties declared: "+titles
+
+		XMLOutputFactory factory = XMLOutputFactory.newInstance()
+		FileOutputStream output = new FileOutputStream(xmlfile)
+		XMLStreamWriter writer = factory.createXMLStreamWriter(output, "UTF-8")
+
+		writer.writeStartDocument("UTF-8","1.0")
+		writer.writeStartElement("text")
+		while (csvreader.readRecord()) {
+			
+			writer.writeStartElement("div")
+
+			for (int i = 0 ; i < titles.size() ; i++) {
+				if (titles[i] == "text") continue
+				writer.writeAttribute(AsciiUtils.buildId(titles.get(i)), csvreader.get(i))
+			}
+
+			writer.writeCharacters(csvreader.get("text")) // get text content
+			writer.writeEndElement() // div
+		}
+
+		writer.writeEndElement() // text
+		writer.close()
+		output.close()
+		csvreader.close()
+
+		return true;
+	}
+	
+	/**
+	* Convert a CSV file to SEVERAL XML file using the first line to declare metadata
+	*
+	* @param csvfile the csvfile
+	* @param outfile the outfile
+	* @param fieldSeparator the field separator
+	* @param textSeparator the text separator
+	* @param encoding the encoding
+	* @return true, if successful
+	*/
+	public boolean toMultipleXMLFiles(File csvfile, File outDir, String fieldSeparator, String textSeparator, String encoding) {
+		CsvReader csvreader = getCSVReader(csvfile, fieldSeparator, encoding)
+		if (csvreader == null) return false
+		
+		if (!outDir.exists()) outDir.mkdirs()
+		if (!outDir.exists()) {
+			println "Out directory does not exist and could not create it"
+			return false;
+		}
+		
+		while (csvreader.readRecord()) {
+			
+			File xmlfile = new File(outDir, csvreader.get("id")+".xml")
+			
+			XMLOutputFactory factory = XMLOutputFactory.newInstance()
+			FileOutputStream output = new FileOutputStream(xmlfile)
+			XMLStreamWriter writer = factory.createXMLStreamWriter(output, "UTF-8")
+	
+			writer.writeStartDocument("UTF-8","1.0")
+			writer.writeStartElement("text")
+			
+			for (int i = 0 ; i < titles.size() ; i++) {
+				if (titles[i] == "text") continue
+				writer.writeAttribute(AsciiUtils.buildId(titles.get(i)), csvreader.get(i))
+			}
+
+			writer.writeCharacters(csvreader.get("text")) // get text content
+			
+			writer.writeEndElement() //text
+			writer.close()
+			output.close()
+		}
+		return true
+	}
+
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	static public void main(String[] args)
+	{
+		String home = System.getProperty("user.home")
+		File csvfile = new File(home, "xml/csv/test.csv")
+		File outfile = new File(home, "xml/csv/test.xml")
+		File outdir = new File(home, "xml/csv/out")
+
+		String fieldSeparator = "\t"
+		String textSeparator = "" //or "'"
+		CsvToXml builder = new CsvToXml()
+		
+		builder.toMultipleXMLFiles(csvfile, outdir, fieldSeparator, textSeparator, "UTF-8")
+		
+		builder.toOneXMLFile(csvfile, outfile, fieldSeparator, textSeparator, "UTF-8")
+	}
+}
Index: tmp/org.txm.core/src/java/org/txm/importer/SAttributesListener.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/SAttributesListener.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/SAttributesListener.groovy	(revision 881)
@@ -0,0 +1,217 @@
+package org.txm.importer
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import javax.xml.stream.*;
+
+/**
+ * Read an XML file and find out : XML elements, their attributes and recursivity level
+ * names are lowercases
+ * 
+ * @author mdecorde
+ *
+ */
+class SAttributesListener {
+
+	private static HashMap<String,ArrayList<String>> structs = new HashMap<String, ArrayList<String>>();
+	private static HashMap<String, Integer> structsCountProf = new HashMap<String, Integer>();
+	private static HashMap<String, Integer> structsMaxProf = new HashMap<String, Integer>();
+	private static String structPath = "/";
+	private XMLStreamReader parser;
+
+	SAttributesListener() {
+		structs = new HashMap<String, ArrayList<String>>();
+		structsCountProf = new HashMap<String, Integer>();
+		structsMaxProf = new HashMap<String, Integer>();
+		structPath = "/";
+	}
+	
+	SAttributesListener(XMLStreamReader parser) {
+		this();
+		this.parser = parser;
+	}
+	
+	public void appendResultsTo(SAttributesListener another) {
+		structs = another.structs;
+		structsCountProf = another.structsCountProf;
+		structsMaxProf = another.structsMaxProf;
+	}
+
+	public void start(def parser) {
+		this.parser = parser;
+	}
+
+	def W = "w";
+	def ANA = "ana";
+	def FORM = "form";
+	/**
+	 * Call this method for each START_ELEMENT stax event
+	 * @param localname the element localname
+	 */
+	public void startElement(String localname) {
+		localname = localname.toLowerCase();
+
+		//String localname = parser.getLocalName();
+		if(localname.equals(W)) return;
+		if(localname.equals(ANA)) return;
+		if(localname.equals(FORM)) return;
+
+		structPath += localname+"/"
+		//println "add: "+structPath
+		def attrs = structs.get(localname)
+		if (!structs.containsKey(localname)) {
+			attrs = new HashSet();
+			structs.put(localname, attrs);
+			structsCountProf.put(localname, 0)
+			structsMaxProf.put(localname, 0)
+		} //else {
+		
+		// get structure recursion
+		int prof = structsCountProf.get(localname)+1
+		structsCountProf.put(localname, prof)
+		if (structsMaxProf.get(localname) < prof )
+			structsMaxProf.put(localname, prof)
+		
+		// get the structure attributes
+		for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+			attrs << parser.getAttributeLocalName(i).toLowerCase();
+		}
+	}
+
+	/**
+	 * Call this method for each END_ELEMENT stax event
+	 * @param localname the element localname
+	 */
+	public void endElement(String localname) {
+		localname = localname.toLowerCase();
+		//String localname = parser.getLocalName();
+		if(localname.equals(W)) return;
+		if(localname.equals(ANA)) return;
+		if(localname.equals(FORM)) return;
+
+		if (structPath.length() > 1) {
+			int idx = structPath.lastIndexOf("/");
+			if (idx > 0) {
+				structPath = structPath.substring(0, idx)
+				//println "end of $localname "+(structsCountProf.get(localname))
+				//if (structsCountProf.get(localname) != null)
+				structsCountProf.put(localname, structsCountProf.get(localname)-1)
+			}
+			//println "pop: "+structPath
+		}
+	}
+
+	boolean firstGetStructs = true;
+	public HashMap<String,ArrayList<String>> getStructs() {
+		if (structsCountProf.get("div") > 0)
+			structs.remove("div1")
+		if (structsCountProf.get("div") > 1)
+			structs.remove("div2")
+		if (structsCountProf.get("div") > 2)
+			structs.remove("div3")
+		if (structsCountProf.get("div") > 3)
+			structs.remove("div4")
+		if (structsCountProf.get("div") > 4)
+			structs.remove("div5")
+		if (structsCountProf.get("div") > 5)
+			structs.remove("div6")
+
+		if (firstGetStructs) {
+			firstGetStructs = false;
+			def keys = []
+			keys.addAll(structs.keySet());
+			for( String key : keys) {
+				def value = structs.get(key);
+				structs.remove(key)
+				structs.put(key.toLowerCase(), value);
+			}
+		}
+
+		return structs;
+	}
+
+	boolean firstGetstructsCountProf = true;
+	public HashMap<String, Integer> getProfs() {
+
+		//		if (firstGetstructsCountProf) {
+		//			firstGetstructsCountProf = false;
+		//			def keys = []
+		//			keys.addAll(structsCountProf.keySet());
+		//			for( String key : keys) {
+		//				def value = structsCountProf.get(key);
+		//				structsCountProf.remove(key)
+		//				structsCountProf.put(key.toLowerCase(), value);
+		//			}
+		//		}
+		HashMap<String, Integer> clone = new HashMap<String, Integer>();
+		for (String key : structsMaxProf.keySet()) {
+			if (structsMaxProf.get(key) > 0)
+				clone.put(key, structsMaxProf.get(key)-1)
+			else
+				clone.put(key, 0)
+		}
+		return clone;
+	}
+	
+	public static SAttributesListener scanFile(File xmlFile) {
+		return scanFile(xmlFile, null)
+	}
+	
+	public void setParser(def parser) {
+		this.parser = parser;
+	}
+	
+	/**
+	 * Merge results in the parentListener
+	 * 
+	 * @param xmlFile
+	 * @param parentListener results are appended to the parentListener if any
+	 * @return
+	 */
+	public static SAttributesListener scanFile(File xmlFile, SAttributesListener parentListener) {
+		
+		def start = false;
+		def inputData = xmlFile.toURI().toURL().openStream();
+		def factory = XMLInputFactory.newInstance();
+		def parser = factory.createXMLStreamReader(inputData);
+		
+		SAttributesListener listener;
+		if (parentListener != null) {
+			listener = parentListener;
+			listener.setParser(parser)
+		} else {
+			listener = new SAttributesListener(parser);
+		}
+		String TEXT = "text";
+		//HashSet<String> types = new HashSet<String>();
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			if (event == XMLStreamConstants.START_ELEMENT) { // start elem
+				if (TEXT.equals(parser.getLocalName())) start = true;
+				if (start) listener.startElement(parser.getLocalName())
+			} else if (event == XMLStreamConstants.END_ELEMENT) { // end elem
+				if (start) listener.endElement(parser.getLocalName())
+				if (TEXT.equals(parser.getLocalName())) start = false;
+			}
+		}
+		parser.close()
+		
+		return listener
+	}
+	
+	public static SAttributesListener scanFiles(File xmlDirectory, String wordTag) {
+		SAttributesListener listener = new SAttributesListener()
+		listener.W = wordTag
+		for (File xmlFile : xmlDirectory.listFiles()) {
+			if (xmlFile.isFile() && !xmlFile.isHidden() && xmlFile.getName().toLowerCase().endsWith(".xml")) {
+				scanFile(xmlFile, listener); // results saved in 'listener' data
+//				println "LISTENER RESULT with ${xmlFile.getName()}: "+listener
+//				println " prof: "+listener.getStructs()
+//				println " prof: "+listener.getProfs()
+//				println " path: "+listener.structPath
+			}
+		}
+		
+		return listener;
+	}
+}
Index: tmp/org.txm.core/src/java/org/txm/importer/ReunitShortLines.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/ReunitShortLines.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/ReunitShortLines.groovy	(revision 881)
@@ -0,0 +1,93 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 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:$
+// $LastChangedRevision:$
+// $LastChangedBy:$ 
+//
+package org.txm.importer
+
+import java.io.File;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class ReunitShortLines.
+ */
+class ReunitShortLines {
+	
+	/**
+	 * Instantiates a new reunit short lines.
+	 *
+	 * @param file the file
+	 * @param maxsize the maxsize
+	 * @param encoding the encoding
+	 */
+	ReunitShortLines(File file, int maxsize, String encoding)
+	{
+		File temp = new File( file.getParentFile(), "reu.txt");
+		Reader input = new InputStreamReader(new FileInputStream(file) , encoding);
+		OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream(temp) , encoding);
+		
+		String line = input.readLine();
+		boolean oklength = true;
+		boolean previousok = false;
+		while(line != null)
+		{
+			if(line.length() == 0)
+			{
+				writer.write("\n");
+				oklength = true;
+			}
+			else if(line.startsWith("**** "))
+			{
+				writer.write("\n"+line);
+				oklength = true;
+			}
+			else
+			{
+			previousok = oklength;
+			oklength = line.length() > maxsize;
+			
+			if(previousok && oklength)
+				writer.write("\n");
+			
+			writer.write(line);
+			
+			if(previousok && ! oklength)
+				writer.write("\n");
+			
+			}
+			line = input.readLine();
+		}
+	}
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		new ReunitShortLines(new File("/home/mdecorde/xml/voeux/Voeux.txt"), 30, "cp1252")
+	}
+}
Index: tmp/org.txm.core/src/java/org/txm/importer/CleanFile.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/CleanFile.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/CleanFile.groovy	(revision 881)
@@ -0,0 +1,135 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 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.
+
+//
+// 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: 2017-06-26 16:53:47 +0200 (lun. 26 juin 2017) $
+// $LastChangedRevision: 3451 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer;
+
+import java.io.BufferedWriter;
+import java.io.File;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader
+
+import org.txm.utils.io.IOUtils;
+
+// TODO: Auto-generated Javadoc
+/**
+ * remove all ctrl char and replace \t by ' '.
+ *
+ * @param infile : the file to process
+ * @param encoding : the encoding of the file
+ */
+class CleanFile {
+	public CleanFile(File infile, String encoding){
+		Reader reader = new BufferedReader(new InputStreamReader(new FileInputStream(infile),encoding));
+		File outfile = File.createTempFile("filecleaner","123456", infile.getParentFile());
+		Writer writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outfile), "UTF-8"));
+		String line = reader.readLine();
+		while(line != null) {
+			writer.write(clean(line) +"\n")
+			line = reader.readLine();
+		}
+		writer.close();
+		reader.close();
+		
+		infile.delete(); // erase old file
+		outfile.renameTo(infile); // rename the copy
+	}
+
+	def static ctrl_reg = /[\p{Cntrl}&&[^\n\t]]/ // all ctrl but \n
+	
+	def static surrogate = "[^\\p{P}&&[^\\u0001-\\uFFFF]]"
+	def static surrogate_reg = /$surrogate/
+	def static surrogate_punct = "[\\p{P}&&[^\\u0001-\\uFFFF]]"
+	def static surrogate_punct_reg = /$surrogate_punct/
+	def static SURROGATE = "_"
+	def static SURROGATE_PUNCT = "☒"
+	def static EMPTY = ""
+	def static SPACE = " "
+	def static TAB = "\t"
+	
+	/**
+	 * Remove ctrl and surrogates chars from a String. except tabs
+	 *
+	 * @param str the str
+	 * @return the cleaned string
+	 */
+	public static String cleanAllButTabs(String str) {
+		str = str.replaceAll(ctrl_reg, EMPTY); // remove all ctrl chars
+		str = str.replaceAll(surrogate_reg, SURROGATE); // replace all surrogate chars
+		str = str.replaceAll(surrogate_punct_reg, SURROGATE_PUNCT); // replace all surrogate punct chars
+		return str;
+	}
+	
+	/**
+	 * Remove ctrl and surrogates chars from a String.
+	 *
+	 * @param str the str
+	 * @return the cleaned string
+	 */
+	public static String clean(String str) {
+		str = str.replace(TAB, SPACE); // replace \t by ' '
+		str = str.replaceAll(ctrl_reg, EMPTY); // remove all ctrl chars
+		str = str.replaceAll(surrogate_reg, SURROGATE); // replace all surrogate chars
+		str = str.replaceAll(surrogate_punct_reg, SURROGATE_PUNCT); // replace all surrogate punct chars
+		return str;
+	}
+	
+	public static void removeSurrogateFromXmlFile(File file, File outputFile) {
+		XMLStreamReader xmlStreamReader = XMLInputFactory.newInstance().createXMLStreamReader( new FileReader( file ) );
+		String fileEncoding = xmlStreamReader.getEncoding();
+		String text = IOUtils.getText(file, fileEncoding)
+		text = CleanFile.clean(text);
+		IOUtils.write(outputFile, text)
+	}
+
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args){
+		File infile = new File("C:\\Documents and Settings\\H\\xml\\cleaner\\test.txt")		
+		String encoding = "CP1252";
+		new CleanFile(infile, encoding);
+	}
+}
Index: tmp/org.txm.core/src/java/org/txm/importer/PartialDomIdentityParser.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/PartialDomIdentityParser.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/PartialDomIdentityParser.groovy	(revision 881)
@@ -0,0 +1,179 @@
+package org.txm.importer
+
+import java.util.ArrayList;
+
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamWriter;
+
+import java.io.File;
+import java.io.Writer;
+import java.net.URL;
+
+import javax.xml.stream.*;
+
+class PartialDomIdentityParser extends StaxIdentityParser {
+	
+	boolean domMode = false;
+	def partialDom = [];
+	def currentNode;
+	
+	public PartialDomIdentityParser(File infile) {
+		super(infile)
+	}
+	
+	protected void processNamespace() {
+		super.processNamespace()
+	}
+	
+	protected void processStartElement()
+	{
+		if (parser.getLocalName() == "test") {
+			println "Build dom..."
+			Tag testTag = new Tag(parser);
+			println testTag.toString()
+			testTag.writeDom(writer)
+		} else {
+			super.processStartElement()
+		}
+	}
+	
+	protected void writeAttributes() {
+		super.writeAttributes();
+	}
+	
+	protected void processCharacters()
+	{
+		super.processCharacters()
+	}
+	
+	protected void processProcessingInstruction()
+	{
+		super.processProcessingInstruction()
+	}
+	
+	protected void processDTD()
+	{
+		super.processDTD()
+	}
+	
+	protected void processCDATA()
+	{
+		super.processCDATA();
+	}
+	
+	protected void processComment()
+	{
+		super.processComment()
+	}
+	
+	protected void processEndElement()
+	{
+		super.processEndElement();
+	}
+	
+	protected void processEndDocument() {
+		super.processEndDocument()
+	}
+	
+	protected void processEntityReference() {
+		super.processEntityReference()
+	}
+	
+	public class Tag {
+		public String[] attnames, attvalues, attprefix;
+		public String localname, prefix
+		int count;
+		public def children = [];
+
+		public Tag(def parser) {
+			prefix = parser.getPrefix()
+			localname = parser.getLocalName();
+			count = parser.getAttributeCount()
+			attnames =  new String[count]
+			attvalues = new String[count]
+			attprefix = new String[count]
+			for (int i = 0 ; i < count ; i++) {
+				attnames[i] = parser.getAttributeLocalName(i)
+				attprefix[i] = parser.getAttributePrefix(i).toString()
+				attvalues[i] = parser.getAttributeValue(i).toString()
+			}
+			buildNodeContent(parser)
+		}
+		
+		private void buildNodeContent(def parser) {
+			try {
+				for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+					//println "event "+event
+					switch (event) {
+						case XMLStreamConstants.START_ELEMENT:
+							children << new Tag(parser);
+							break;
+						case XMLStreamConstants.CHARACTERS:
+							children << parser.getText()
+							break;
+						case XMLStreamConstants.END_ELEMENT:
+							if (localname == parser.getLocalName()) {
+								return; // end of stax parsing, the Tag is built
+							}
+							break;
+						case XMLStreamConstants.END_DOCUMENT:
+							println "ERROR: END OF DOCUMENT REACHED"
+							break;
+					}
+				}
+			} catch(Exception e) {
+				println("Error while parsing partial content of file "+inputurl);
+				println("Location "+parser.getLocation());
+				org.txm.utils.logger.Log.printStackTrace(e);
+				return;
+			}
+		}
+
+		public String toString() {
+			def out = new StringWriter()
+			XMLStreamWriter strwriter = outfactory.createXMLStreamWriter(out);//create a new file
+			println ""+(strwriter != null)
+			writeDom(strwriter);
+			return out.toString()
+		}
+		
+		public writeDom(def writer) {
+			// Open the Tag
+			if (prefix != null && prefix.length() > 0)
+				writer.writeStartElement(prefix+":"+localname)
+			else
+				writer.writeStartElement(localname)
+
+			// write Attributes
+			for (int i = 0 ; i < count ; i++) {
+				if (attprefix[i] != null && attprefix[i].length() > 0) {
+					writer.writeAttribute(attprefix[i]+":"+attnames[i], attvalues[i])
+				} else {
+					writer.writeAttribute(attnames[i], attvalues[i])
+				}
+			}
+			
+			// write children recursivelly
+			for (def child : children) {
+				if (child instanceof String) {
+					writer.writeCharacters(child)
+				} else if (child instanceof Tag) {
+					child.writeDom(writer)
+				} else {
+					println "Error: can't write $child"
+				}
+			}
+			
+			// close the Tag
+			writer.writeEndElement() 
+		}
+	}
+	
+	public static void main(String[] args) {
+		File infile = new File("/home/mdecorde/xml/partialdom/test.xml")
+		File outfile = new File("/home/mdecorde/xml/partialdom/test-o.xml")
+		PartialDomIdentityParser p = new PartialDomIdentityParser(infile);
+		println p.process(outfile)
+	}
+}
Index: tmp/org.txm.core/src/java/org/txm/importer/SetNewXmlDocumentRoot.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/SetNewXmlDocumentRoot.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/SetNewXmlDocumentRoot.groovy	(revision 881)
@@ -0,0 +1,51 @@
+package org.txm.importer
+
+import java.io.File;
+
+import org.w3c.dom.Document;
+import java.io.File;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import javax.xml.parsers.*;
+import javax.xml.xpath.*;
+import javax.xml.transform.*;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import org.txm.importer.PersonalNamespaceContext;
+
+class SetNewXmlDocumentRoot {
+	public static boolean process(File xmlfile, String xpath) {
+		DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
+		domFactory.setNamespaceAware(true); // never forget this!
+		domFactory.setXIncludeAware(true);
+		DocumentBuilder builder = domFactory.newDocumentBuilder();
+		
+		Document doc = builder.parse(xmlfile);
+		Element root = doc.getDocumentElement();
+		
+		XPathFactory xpathfactory = XPathFactory.newInstance();
+		def _xpath = xpathfactory.newXPath();
+		_xpath.setNamespaceContext(new PersonalNamespaceContext());
+		def expr = _xpath.compile(xpath);
+		def nodes = expr.evaluate(doc, XPathConstants.NODESET);
+
+		for(Node node : nodes) {
+
+			Document document = builder.newDocument();
+			document.setXmlVersion("1.0");
+			document.setXmlStandalone(true);
+			Node adopted = document.adoptNode(node)
+			document.appendChild(adopted)
+			return org.txm.utils.xml.DomUtils.save(document, xmlfile);
+		}
+		return false;
+	}
+	
+	//		File xmlfile = new File("/home/mdecorde/xml/txmrefman/TEI/refman.xml")
+	//		File outfile = new File("/home/mdecorde/xml/txmrefman/TEI/refman-o.xml")
+	//		String xpath = "//body"
+	
+}
Index: tmp/org.txm.core/src/java/org/txm/importer/TabulatedToXml.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/TabulatedToXml.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/TabulatedToXml.groovy	(revision 881)
@@ -0,0 +1,244 @@
+package org.txm.importer 
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 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:$
+// $LastChangedRevision:$
+// $LastChangedBy:$ 
+//
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+import java.util.ArrayList;
+
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamWriter;
+
+// TODO: Auto-generated Javadoc
+/**
+ * Tool to convert Tabulated file to xml file. Such as CWB files or TreeTagger ouput
+ */
+public class TabulatedToXml {
+	String[] colnames;
+	
+	/** The texttag. */
+	String texttag;
+	
+	/** The tag. */
+	boolean tag;
+	
+	/** The no col form. */
+	int noColForm;
+	
+	/**
+	 * Instantiates a new tabulated to xml.
+	 *
+	 * @param colnames the word properties name
+	 * @param texttag the element that represents a text unit
+	 * @param tag if true, split the file by the texttag, if false wrap the file with an element texttag
+	 */
+	public TabulatedToXml(String[] colnames, String texttag, boolean tag) throws Exception
+	{
+		this.colnames = colnames;
+		this.texttag = texttag;
+		this.tag = tag;
+		this.noColForm = 0;
+	}
+	
+	/**
+	 * Instantiates a new tabulated to xml.
+	 *
+	 * @param colnames the colnames
+	 * @param texttag the texttag
+	 * @param tag the tag
+	 * @param noColForm the no col form
+	 */
+	public TabulatedToXml(String[] colnames, String texttag, boolean tag, int noColForm) throws Exception
+	{
+		this.colnames = colnames;
+		this.texttag = texttag;
+		this.tag = tag;
+		this.noColForm = noColForm;
+	}
+	
+	/**
+	 * Process.
+	 *
+	 * @param tabulatedfile the tabulatedfile
+	 * @param xmlfile the xmlfile
+	 * @param encoding the encoding
+	 * @return true, if successful
+	 */
+	public boolean process(File tabulatedfile, File xmlfile, String encoding)
+	{
+		BufferedReader reader = new BufferedReader(new FileReader(tabulatedfile));
+		FileOutputStream output = new FileOutputStream(xmlfile)
+		
+		XMLOutputFactory factory = XMLOutputFactory.newInstance();
+		XMLStreamWriter writer = factory.createXMLStreamWriter(output, "UTF-8"); 
+		
+		writer.writeStartDocument("UTF-8", "1.0")
+		
+		if(!tag) // there is no tag, we must wrap the content in an element
+		{
+			if(texttag.length() == 0)
+			{
+				println "no text element given"
+				return false;
+			}
+			writer.writeStartElement(texttag);
+			String filename = tabulatedfile.getName()
+			filename = filename.substring(0, filename.lastIndexOf("."));
+			writer.writeAttribute("id", filename);
+		}
+		
+		String line = reader.readLine();
+		int noline = 0;
+		while(line != null)
+		{
+			if(tag && line.startsWith("</")) // closing xml tag
+			{
+				writer.writeEndElement();
+			}
+			else if(tag && line.startsWith("<")) // opening xml tag
+			{
+				int firstblank = line.indexOf(" ");
+				String tagname;
+				String[] attrnamevalues = null;
+				if(firstblank > 0) // contains attributes
+				{
+					tagname = line.substring(1, firstblank);
+					line = line.substring(firstblank+1, line.length() -1);
+					attrnamevalues = line.split(" ");
+				}
+				else // no attr
+				{
+					tagname = line.substring(1, line.length() -1);
+				}
+				
+				writer.writeStartElement(tagname);
+				if(attrnamevalues != null)
+				{
+					for(String namevalue : attrnamevalues)
+					{
+						int egalidx = namevalue.indexOf("=");
+						String name = namevalue.substring(0, egalidx);
+						String value = namevalue.substring(egalidx+1, namevalue.length());
+						
+						writer.writeAttribute(name, value.replace("\"",""));
+					}
+				}
+			}
+			else // it's a word
+			{
+				String[] split = line.split("\t");
+				if(split.length != colnames.length)
+				{
+					System.out.println("Error line "+noline+" : missing columns :"+split.length+" instead of "+ colnames.length);
+					println "line: "+line
+				}
+				String form = "";
+				writer.writeStartElement("w");
+				for(int i = 0 ; i < colnames.length ; i++)
+				{
+					if(i == noColForm)
+					{
+						form = split[0];
+					}
+					else
+					{
+						if(split.length <= i)
+						writer.writeAttribute(colnames[i], "N/A");
+						else
+						writer.writeAttribute(colnames[i], split[i]);
+					}
+				}
+				writer.writeCharacters(form);
+				writer.writeEndElement();
+				
+			}
+			noline++;
+			line = reader.readLine();
+		}
+		
+		if(!tag) // there is no tag, we close the wrapping element
+		{
+			writer.writeEndElement();
+		}
+		
+		writer.close();
+		output.close();
+		reader.close();
+	}
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		String home = System.getProperty("user.home");
+		// sample_TXM_LA.vrt
+		/*
+		 File tabulatedfile = new File(home, "xml/tabulated/sample_TXM_LA.vrt");
+		 File xmlfile = new File(home, "xml/tabulated/sample_TXM_LA.xml");
+		 String[] colnames = ["form", "pos", "lem", "func"]; // TreeTagger
+		 boolean tag = true;
+		 String encoding = "UTF-8";
+		 try {
+		 TabulatedToXml ttx = new TabulatedToXml(colnames, "", tag);
+		 ttx.process(tabulatedfile, xmlfile, encoding)
+		 } catch (Exception e) {
+		 // TODO Auto-generated catch block
+		 org.txm.utils.logger.Log.printStackTrace(e);
+		 }*/
+		File srcdir = new File(home, "xml/Bendinelli");
+		File outdir = new File(home, "xml/Bendinelli/xml");
+		println "srcdir: "+srcdir
+		outdir.deleteDir();
+		outdir.mkdir();
+		
+		String[] colnames = ["form", "pos", "lem"]; // TreeTagger
+		boolean tag = false;
+		String encoding = "UTF-8";
+		
+		TabulatedToXml ttx = new TabulatedToXml(colnames, "debat", tag);
+		for(File tabulatedfile : srcdir.listFiles())
+		{
+			if(tabulatedfile.getName().endsWith(".txt"))
+			{
+				String filename = tabulatedfile.getName()
+				filename = filename.substring(0, filename.lastIndexOf("."));
+				File xmlfile = new File(outdir, filename+".xml")
+				println "process: "+tabulatedfile
+				ttx.process(tabulatedfile, xmlfile, encoding)
+			}
+		}
+		
+		println "Done"
+	}
+}
\ No newline at end of file
Index: tmp/org.txm.core/src/java/org/txm/importer/XMLTXM2WTC.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/XMLTXM2WTC.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/XMLTXM2WTC.groovy	(revision 881)
@@ -0,0 +1,508 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 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: 2017-04-11 15:30:35 +0200 (mar. 11 avril 2017) $
+// $LastChangedRevision: 3426 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer
+
+import java.text.DateFormat;
+import java.util.Date;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import javax.xml.stream.*;
+import java.net.URL;
+import org.txm.importer.filters.*;
+// TODO: Auto-generated Javadoc
+
+/**
+ * The Class XMLTXM2CQP.
+ *
+ * @author mdecorde
+ * simple transofmration of a xml-tei-txm file into cqp file
+ */
+
+class XMLTXM2CQP
+{
+	
+	/** The url. */
+	private def url;
+	
+	/** The input data. */
+	private def inputData;
+	
+	/** The factory. */
+	private def factory;
+	
+	/** The parser. */
+	private XMLStreamReader parser;
+	
+	/** The output. */
+	private def output;
+	
+	/** The hashmap of txm:form and txm:ana values and the attributes hash*/
+	LinkedHashMap<String, String> anahash = new LinkedHashMap<String, String>();
+	LinkedHashMap<String, String> formhash = new LinkedHashMap<String, String>();
+	LinkedHashMap<String, String> wordattributes = new LinkedHashMap<String, String>();
+	
+	/** The balisesfound. */
+	HashMap<String, List<String>> balisesfound;// = new HashMap<String, List<String>>();
+
+	/** The balises to keep. */
+	List<String> balisesToKeep;
+	
+	/** The send to p attributes. */
+	HashMap <String, List<String>> sendToPAttributes;// = new HashMap<String, List<String>>();
+	
+	/** The injected p attributes. */
+	List<String> injectedPAttributes = new ArrayList<String>();
+	
+	/** The default reference : a pattern + the properties to use */
+	List<String> defaultReferences = new ArrayList<String>();
+	String defaultReferencePattern;
+	
+	/** The injected p attributes values. */
+	HashMap <String, String> injectedPAttributesValues;// = new ArrayList<String>();
+	
+	/** The addinfos. */
+	boolean addinfos = false;
+	
+	/** The txtname. */
+	String txtname;
+	
+	/** The base. */
+	String base;
+	
+	/** The project. */
+	String project;
+	
+	/** The lang. */
+	public String lang= "fr";
+	public String currentForm;
+	public String currentAna;
+	
+	/**
+	 * Sets the lang.
+	 *
+	 * @param lang the lang
+	 * @return the java.lang. object
+	 */
+	public setLang(String lang)
+	{
+		this.lang = lang;
+	}
+	
+	/**
+	 * Instantiates a new xMLTX m2 cqp.
+	 *
+	 * @param url the url
+	 */
+	public XMLTXM2CQP(URL url){
+		try {
+			this.url = url;
+			inputData = url.openStream();
+			factory = XMLInputFactory.newInstance();
+			
+			parser = factory.createXMLStreamReader(inputData);
+			
+			
+		} catch (XMLStreamException ex) {
+			System.out.println(ex);
+		}catch (IOException ex) {
+			System.out.println("IOException while parsing ");
+		}
+	}
+	
+	/**
+	 * Sets the text info.
+	 *
+	 * @param name the name
+	 * @param base the base
+	 * @param project the project
+	 */
+	public void setTextInfo(String name, String base, String project)
+	{
+		this.addinfos = true;
+		this.txtname= name;
+		this.base = base;
+		this.project = project;
+	}
+	
+	/**
+	 * Creates the output.
+	 *
+	 * @param outfile the outfile
+	 * @return true, if successful
+	 */
+	private boolean createOutput(File outfile)
+	{
+		try {
+			output = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outfile, outfile.exists()) , "UTF-8"));
+			return true;
+		} catch (Exception e) {
+			System.err.println(e);
+			return false;
+		}
+	}
+	
+	/** The haspb. */
+	boolean haspb = false;
+	
+	/** The haslb. */
+	boolean haslb = false;
+	
+	/**
+	 * Transform file.
+	 *
+	 * @param outfile the outfile
+	 * @return true, if successful
+	 */
+	public boolean transformFile(File outfile)
+	{
+		if(balisesToKeep == null)
+		{
+			println "no element has been defined to be keeped"
+			return false;
+		}
+		
+		haspb = false;
+		haslb = false;	
+		
+		boolean flagAna;
+		boolean flagForm;
+		boolean flagWord;
+		String vWord = "";
+		String vForm = "";
+		String vAna = "";
+		
+		String lb_id = "";
+		String pb_id = "";
+		
+		wordattributes = [:];
+		balisesfound = new HashMap<String, List<String>>();
+		
+		
+		if(!createOutput(outfile))
+			return false;
+		
+		if(sendToPAttributes != null)
+		{
+			for(String tag: sendToPAttributes.keySet())
+				for(String attr : sendToPAttributes.get(tag))
+					injectedPAttributes.add(tag+attr);
+			injectedPAttributesValues = [:];
+		}
+		
+		//output.write("<txmcorpus lang=\""+lang+"\">\n");
+		balisesfound.put("txmcorpus",["lang"]);
+		
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			switch (event) 
+			{
+				case XMLStreamConstants.START_ELEMENT:
+					String localname = parser.getLocalName().toLowerCase();
+				
+				// we will only declare found tags in cwb registry
+					if(balisesToKeep.contains(localname)) {
+						if(!balisesfound.containsKey(localname)) {
+							balisesfound.put(localname, []);
+						}
+						
+						List<String> attrlist = balisesfound.get(localname);
+						for (int i= 0 ; i < parser.getAttributeCount() ;i++ )
+							if(!attrlist.contains(parser.getAttributeLocalName(i)))
+								attrlist.add(parser.getAttributeLocalName(i));
+					}
+					
+					switch (localname) {						
+						case "w": // get word id !!
+							wordattributes.put("id", parser.getAttributeValue(null, "id"));
+							break;
+						
+						case "form":
+							flagForm = true;
+							currentForm = parser.getAttributeValue(null, "type");
+							if(currentForm == null)
+								currentForm = "default";
+							vForm = "";
+							break;
+						
+						case "ana":
+							flagAna = true;
+							vAna ="";
+						
+							currentAna = (parser.getAttributeValue(null,"type"));
+							if(currentAna != null)
+								currentAna = currentAna.substring(1)// remove the #
+							else
+								flagAna = false;
+							break;
+						
+						default:
+							
+							if (sendToPAttributes != null) {
+								//println "should store $localname ? with "+sendToPAttributes.keySet()
+								if (sendToPAttributes.keySet().contains(localname)) {
+									//println "store attr of "+localname
+									List<String> attrs = sendToPAttributes.get(localname);
+									for (int i= 0 ; i < parser.getAttributeCount() ;i++ ) {
+										if (attrs.contains(parser.getAttributeLocalName(i))) {
+											injectedPAttributesValues.put(localname+parser.getAttributeLocalName(i).toLowerCase(),parser.getAttributeValue(i)) 
+										}
+									}
+								}
+							}
+							
+							if (balisesToKeep.contains(localname)) {
+								output.write("<"+localname);
+								//println "write <"+localname+"..."
+								//write attributes
+								boolean idwritten = false;
+								boolean basewritten = false;
+								boolean projectwritten = false;
+								for (int i= 0 ; i < parser.getAttributeCount() ;i++ ) {
+									String attrname = parser.getAttributeLocalName(i).toLowerCase();
+									if (attrname == "id")
+										idwritten = true;
+									if (attrname == "base")
+										basewritten = true;
+									if (attrname == "project")
+										projectwritten = true;
+									output.write(" "+attrname+"=\""+parser.getAttributeValue(i).replace("\"", "'")+"\"" );
+								}
+								
+								if (localname.equals("text"))
+									if (addinfos) {
+										List<String> attrlist = balisesfound.get(localname);
+	
+										if (!idwritten) {
+											output.write(" id=\""+txtname+"\"")
+											attrlist.add("id");
+										}
+										if (!basewritten) {
+											output.write(" base=\""+base+"\"");
+											attrlist.add("base");
+										}
+										if (!projectwritten) {
+											output.write(" project=\""+project+"\"");
+											attrlist.add("project");
+										}											
+									}	
+											
+								// finalize tag
+								output.write(">\n");
+							}
+					}
+					break;
+				
+				case XMLStreamConstants.END_ELEMENT:
+					String localname = parser.getLocalName().toLowerCase();
+					switch (localname) {
+						case "form":
+							if(flagForm)
+								formhash.put(currentForm, vForm);
+							flagForm = false; 
+							break;
+						
+						case "ana":
+							if(flagAna)
+								anahash.put(currentAna, vAna);
+							flagAna = false;
+							break;
+						
+						case "w":
+							vWord = "";
+							vWord = formhash.get("default").replaceAll("&", "&amp;").replaceAll("<", "&lt;"); // get default form
+							for (String form : formhash.keySet()) // and the others
+								if (form != "default")
+									vWord += "\t"+formhash.get(form);
+							
+							for (String type : wordattributes.keySet()) // only word id ?
+								vWord+="\t"+wordattributes.get(type)
+						
+							if (sendToPAttributes != null) // word attributes from structure properties
+							{
+								//println "injectedPAttributesValues: "+injectedPAttributesValues
+								for(String pattr : injectedPAttributes)
+									vWord+="\t"+injectedPAttributesValues.get(pattr) ;//les attributs injecter
+							}
+							
+							for (String type : anahash.keySet()) // word annotations in txm:ana
+								vWord+="\t"+anahash.get(type)
+							
+							output.write(vWord+"\n");
+							vWord= "";
+							break;
+						
+						default:
+							if (sendToPAttributes != null) // reset structure properties
+							{
+								if (sendToPAttributes.keySet().contains(localname)) {
+									for (String attr : sendToPAttributes.get(localname)) {
+										injectedPAttributesValues.put(attr, "N/A") 
+									}
+								}
+							}
+							
+							if (balisesToKeep.contains(localname)) {
+								output.write("</"+localname+">\n");
+							}
+					}
+					break;
+				
+				case XMLStreamConstants.CHARACTERS:
+					if (flagForm) {
+						vForm += parser.getText().trim();
+					}
+					if (flagAna) {
+						vAna += parser.getText().trim();
+					}
+					break;
+			}
+		}
+		//output.write("</txmcorpus>\n"); 
+		output.close();
+		parser.close();
+		
+		return true;
+	}
+	
+	/**
+	 * Gets the p attributs.
+	 *
+	 * @return the p attributs
+	 */
+	public List<String> getpAttributs()
+	{
+		def pAttributs = [];
+		
+		for (String wordattr : wordattributes.keySet()) {
+			pAttributs.add(wordattr);
+		}
+		
+		if (sendToPAttributes != null)
+			for (String pAttr : this.injectedPAttributes)
+				pAttributs.add(pAttr);
+		
+		for (String anakey : anahash.keySet()) {
+			pAttributs.add(anakey);
+		}
+		
+		return pAttributs;
+	}
+	
+	/**
+	 * Gets the s attributs.
+	 *
+	 * @return the s attributs
+	 */
+	public List<String> getsAttributs()
+	{
+		println balisesfound
+		def sAttributs = [];
+		for (String balise : this.balisesfound.keySet()) {
+			List<String> sAtt = this.balisesfound.get(balise);
+			String attributes = "";
+			for (String attr : sAtt) {
+				attributes+="+"+attr;
+			}
+			
+			if (sAtt.size() > 0)
+				sAttributs.add(balise +":"+attributes);
+			else
+				sAttributs.add(balise);
+		}
+		return sAttributs;
+	}
+	
+	/**
+	 * Sets the balises to keep.
+	 *
+	 * @param balisesToKeep the new balises to keep
+	 */
+	public void setBalisesToKeep(List<String> balisesToKeep)
+	{
+		if (balisesToKeep != null)
+			this.balisesToKeep = balisesToKeep;
+		else
+			println("Warning: the list of elements to keep is null")
+	}
+	
+	/**
+	 * Sets the defautl reference pattern
+	 * TODO: not implemented
+	 *
+	 * @param balisesToKeep the new balises to keep
+	 */
+	public void setDefaultReference(String pattern, List<String> strucProperties)
+	{
+		if (defaultReferencePattern != null) {
+			this.defaultReferences = defaultReferences;
+			defaultReferencePattern = pattern;
+		}
+	}
+	
+	
+	/**
+	 * Sets the send to p attributes.
+	 *
+	 * @param sendus the sendus
+	 */
+	public void setSendToPAttributes(HashMap<String, List<String>> sendus)
+	{
+		if (sendus != null)
+			this.sendToPAttributes = sendus;
+		else
+			println("Warning: the pAttributes to inject is null")
+	}
+	
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args) {
+		
+		String rootDir = "/home/mdecorde/TXM/corpora/CORNEILLEMOLIERETER/txm/CORNEILLEMOLIERETER";
+		
+		File srcfile = new File(rootDir,"CORNEILLEP_AGESILAS_1666.xml");
+		println srcfile.exists()
+		File cqpfile = new File(rootDir, "out/CORNEILLEP_AGESILAS_1666.cqp");
+		new File(rootDir,"out").deleteDir()
+		new File(rootDir,"out").mkdir()
+		
+		System.out.println("XMLTXM2CQP : "+srcfile+" >> "+cqpfile);
+		def builder = new XMLTXM2CQP(srcfile.toURL());
+		def balises = ["text", "s"];
+		builder.setBalisesToKeep(balises);
+		builder.transformFile(cqpfile);
+		
+		println("SATTRIBUTS: "+builder.getsAttributs());
+		println("PATTRIBUTS: "+builder.getpAttributs());
+		return;
+	}
+}
+
Index: tmp/org.txm.core/src/java/org/txm/importer/ReadImportParameters.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/ReadImportParameters.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/ReadImportParameters.groovy	(revision 881)
@@ -0,0 +1,277 @@
+package org.txm.importer
+
+import javax.xml.stream.*;
+import java.net.URL;
+/**
+ * Read the import.xml file
+ * @author mdecorde
+ */
+class ReadImportParameters {
+	HashMap<String, ArrayList<String>> links = new HashMap<String, ArrayList<String>>();;
+	HashMap<String, String> structs = new HashMap<String, String>();
+	HashMap<String, Integer> levels = new HashMap<String, Integer>();
+	
+	HashMap<String, HashMap<String, String>> metadatas = [:];
+	HashMap<String, HashMap<String, String>> pattributes = [:];
+	HashMap<String, HashMap<String, String>> sattributes = [:];
+	
+	HashMap<String, String> biblios = [:];
+	
+	HashMap<String, String> uis = [:];
+	
+	HashMap<String, ArrayList<HashMap<String, String>>> editions = [:];
+	
+	String basename;
+	String encoding;
+	String language;
+	String rootDir;
+	String script;
+	String xslt;
+	String author;
+	String description;
+	
+	boolean debug;
+
+	public ReadImportParameters()
+	{
+
+	}
+
+	public boolean read(File infile)
+	{
+		try {
+			def url = infile.toURI().toURL();
+			def inputData = url.openStream();
+			def factory = XMLInputFactory.newInstance();
+			def parser = factory.createXMLStreamReader(inputData);
+			return read(parser);
+		} catch (XMLStreamException ex) {
+			System.out.println(ex);
+		}catch (IOException ex) {
+			System.out.println("IOException while parsing ");
+		}
+	}
+
+	public boolean read(def parser)
+	{
+		boolean startAlignInfos = false;
+		boolean startEditions = false;
+		boolean startMetadatas = false;
+		boolean startPAttributes = false;
+		boolean startSAttributes = false;
+		boolean startTokenizer = false;
+		
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next())
+		{
+			switch (event) {
+
+				case XMLStreamConstants.END_ELEMENT:
+					String localname = parser.getLocalName();
+					if(localname == "linkGrp")
+					{
+						startAlignInfos = false;
+					}
+					else if(localname == "metadatas")
+					{
+						startMetadatas = false;
+					}
+					else if(localname == "editions")
+					{
+						startEditions = false;
+					}
+					else if(localname == "pattributes")
+					{
+						startPAttributes = false;
+					}
+					else if(localname == "sattributes")
+					{
+						startSAttributes = false;
+					}
+					else if(localname == "tokenizer")
+					{
+						startSAttributes = false;
+					}
+					break;
+
+				case XMLStreamConstants.START_ELEMENT:
+					String localname = parser.getLocalName();
+					if (localname == "import")
+					{
+						basename = parser.getAttributeValue(null, "name");
+						encoding = parser.getAttributeValue(null, "encoding");
+						language = parser.getAttributeValue(null, "lang");
+						rootDir = parser.getAttributeValue(null, "rootDir");
+						script = parser.getAttributeValue(null, "script");
+						xslt = parser.getAttributeValue(null, "xslt");
+						author = parser.getAttributeValue(null, "author")
+						description = parser.getAttributeValue(null, "desc");
+						
+						boolean debug;
+					}
+					else if(localname == "editions")
+					{
+						startEditions = true;
+					}
+					else if(localname == "edition")
+					{
+						String corpus = parser.getAttributeValue(null, "corpus")
+						if(!editions.containsKey(corpus))
+							editions.put(corpus, []);
+						def list = editions.get(corpus);
+						def map = [:]
+						list.add(map)
+						
+						map.put("name", parser.getAttributeValue(null, "name"))
+						map.put("mode", parser.getAttributeValue(null, "mode"))
+						map.put("script", parser.getAttributeValue(null, "script"))
+					}
+					else if (localname == "metadatas") {
+						startMetadatas = true;
+					}
+					else if (localname == "metadata" && startMetadatas) {
+						metadatas.put(parser.getAttributeValue(null, "id"), 
+							["id":parser.getAttributeValue(null, "id"),
+							"shortname":parser.getAttributeValue(null, "shortname"),
+							"longname":parser.getAttributeValue(null, "longname"),
+							"type":parser.getAttributeValue(null, "type"),
+							"selection":parser.getAttributeValue(null, "selection"),
+							"partition":parser.getAttributeValue(null, "partition"),
+							"display":parser.getAttributeValue(null, "display"),])
+					}
+					else if (localname == "pattributes") {
+						startPAttributes = true;
+					} else if(localname == "pattribute" && startPAttributes) {
+						pattributes.put(parser.getAttributeValue(null, "id"), 
+							["id":parser.getAttributeValue(null, "id"),
+							"shortname":parser.getAttributeValue(null, "shortname"),
+							"longname":parser.getAttributeValue(null, "longname"),
+							"type":parser.getAttributeValue(null, "type"),
+							"renderer":parser.getAttributeValue(null, "renderer"),
+							"tooltip":parser.getAttributeValue(null, "tooltip"),
+							"display":parser.getAttributeValue(null, "display"),
+							"min":parser.getAttributeValue(null, "min"),
+							"max":parser.getAttributeValue(null, "max"),
+							"inputFormat":parser.getAttributeValue(null, "inputFormat"),
+							"outputFormat":parser.getAttributeValue(null, "outputFormat"),
+							"position":parser.getAttributeValue(null, "position"),
+							"sortBy":parser.getAttributeValue(null, "sortBy")])
+					}
+					else if (localname == "sattributes") {
+						startSAttributes = true;
+					}
+					else if (localname == "sattribute" && startSAttributes) {
+						sattributes.put(parser.getAttributeValue(null, "id"), 
+							["id":parser.getAttributeValue(null, "id"),
+							"shortname":parser.getAttributeValue(null, "shortname"),
+							"longname":parser.getAttributeValue(null, "longname"),
+							"type":parser.getAttributeValue(null, "type"),
+							"renderer":parser.getAttributeValue(null, "renderer"),
+							"tooltip":parser.getAttributeValue(null, "tooltip"),
+							"pattern":parser.getAttributeValue(null, "renderer"),
+							"import":parser.getAttributeValue(null, "import"),
+							"min":parser.getAttributeValue(null, "min"),
+							"max":parser.getAttributeValue(null, "max"),
+							"mandatory":parser.getAttributeValue(null, "mandatory"),
+							"order":parser.getAttributeValue(null, "order"),
+							"inputFormat":parser.getAttributeValue(null, "inputFormat"),
+							"outputFormat":parser.getAttributeValue(null, "outputFormat"),])
+					} else if (localname == "link" && startAlignInfos) {
+						String target = parser.getAttributeValue(null, "target");
+						String struct = parser.getAttributeValue(null, "alignElement");
+						String level = parser.getAttributeValue(null, "alignLevel")
+						ArrayList<String> corpora = target.split("#");
+						for (int i = 0 ; i < corpora.size() ; i++) {
+							corpora[i] = corpora[i].trim()
+							if (corpora[i].length() == 0) {
+								corpora.remove(i)
+								i--
+							}
+						}
+
+						if (level == null)
+							level = "1";
+
+						if (corpora.size() == 0) {
+							println "no corpus aligned: "+parser.getLocation()
+							return false;
+						}
+						if (struct == null) {
+							println "a sturcture is missing: "+parser.getLocation()
+							return false;
+						}
+						links.put(target, corpora)
+						structs.put(target, struct)
+						levels.put(target, level.toInteger())
+					} else if(localname == "linkGrp" && parser.getAttributeValue(null, "type") == "align") {
+						startAlignInfos = true;
+					} else if(localname == "tokenizer") {
+						startSAttributes = true;
+					}
+			}
+		}
+	}
+
+	public Set<String> getAlignements()
+	{
+		return links.keySet();
+	}
+
+	public ArrayList<String> getTargets(String alignement)
+	{
+		return links.get(alignement);
+	}
+
+	public String getStructure(String alignement)
+	{
+		return structs.get(alignement);
+	}
+
+	public int getLevel(String alignement)
+	{
+		return levels.get(alignement);
+	}
+
+	public void dump()
+	{
+		println "LINKS"
+		for(String link : links.keySet())
+		{
+			println link
+			println " corpus: "+links.get(link)
+			println " struct: "+structs.get(link)
+			println " level: "+levels.get(link)
+		}
+		
+		println "PROPERTIES"
+		println "metadatas $metadatas"
+		println " pattributes $pattributes"
+		println " sattributes $sattributes"
+		
+		println " biblios $biblios"
+		
+		println "uis $uis"
+		
+		println " editions $editions"
+		
+		println "HEADER"
+		println " basename $basename"
+		println " encoding $encoding"
+		println " language $language"
+		println " rootDir $rootDir"
+		println " script $script"
+		println " xslt $xslt"
+		println " author $author"
+		println " description $description"
+		println "DEBUG: $debug"
+	}
+
+	public static void main(String[] args)
+	{
+		String userhome = System.getProperty("user.home");
+		File alignfile = new File(userhome, "xml/xmltxmpara/align.xml")
+		ReadImportParameters parameters = new ReadImportParameters();
+		parameters.read(alignfile);
+		parameters.dump();
+	}
+}
+
Index: tmp/org.txm.core/src/java/org/txm/importer/MileStoneProjection.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/MileStoneProjection.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/MileStoneProjection.groovy	(revision 881)
@@ -0,0 +1,110 @@
+package org.txm.importer
+
+import java.io.File;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamWriter;
+import java.net.URL;
+import javax.xml.stream.*;
+import org.txm.importer.filters.*;
+import org.txm.importer.PersonalNamespaceContext;
+
+/**
+ * add 2 attributes per element to encode the distance to the previous milestone and next milestone
+ * TODO: only the first attribute is implemented
+ * 
+ * @author mdecorde
+ *
+ */
+class MileStoneProjection extends StaxIdentityParser {
+	String wordTag
+	String mileStoneTag
+	String startTag
+	boolean start = false
+
+	int mileStoneDistance = 0
+
+	String mileStoneID = ""
+	def milestonesLength = []
+	int milestonesCounter = 0
+	boolean secondPass = false
+	
+	String msIdAttributeName
+	String msStartAttributeName
+	String msEndAttributeName
+
+	public MileStoneProjection(File inputFile, String startTag, String wordTag, String mileStoneTag) {
+		super(inputFile)
+
+		this.wordTag = wordTag
+		this.mileStoneTag = mileStoneTag
+		mileStoneID = mileStoneTag+"_0"
+		this.startTag = startTag
+		this.start = false;
+		
+		msIdAttributeName = mileStoneTag+"id";
+		msStartAttributeName = mileStoneTag+"start";
+		msEndAttributeName = mileStoneTag+"end";
+
+		fetchMilestoneLengths();
+		start = false // reset
+	}
+
+	public void fetchMilestoneLengths() {
+		def inputData = inputurl.openStream();
+		def factory = XMLInputFactory.newInstance();
+		def parser = factory.createXMLStreamReader(inputData);
+
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			switch (event) {
+				case XMLStreamConstants.START_ELEMENT:
+					localname = parser.getLocalName()
+					if (start && localname == mileStoneTag) {
+						milestonesLength << mileStoneDistance;
+						mileStoneDistance = 0
+						milestonesCounter++;
+					} else if (start && localname == wordTag) {
+						mileStoneDistance++
+					} else if (localname == startTag) {
+						start = true
+					}
+					break;
+			}
+		}
+		milestonesLength[milestonesCounter] = mileStoneDistance;
+		parser.close()
+		milestonesCounter = 0;
+	}
+
+
+	
+	public void processStartElement() {
+		super.processStartElement();
+
+		if (start && localname == mileStoneTag) {
+			mileStoneDistance = 0
+			mileStoneID = parser.getAttributeValue(null, "id")
+			if (mileStoneID == null) mileStoneID = parser.getAttributeValue("xml", "id");
+			if (mileStoneID == null) mileStoneID = "0";
+			
+			milestonesCounter++;
+		} else if (start && localname == wordTag) {
+			// println "end of $milestonesCounter len="+milestonesLength[milestonesCounter]+" dist="+mileStoneDistance
+			writer.writeAttribute(msEndAttributeName, Integer.toString((milestonesLength[milestonesCounter] - mileStoneDistance - 1)))
+			writer.writeAttribute(msStartAttributeName, Integer.toString(mileStoneDistance))
+			writer.writeAttribute(msIdAttributeName, mileStoneID)
+
+			mileStoneDistance++
+		} else if (localname == startTag) {
+			start = true
+		}
+	}
+
+	public static void main(String[] args) {
+		File inputFile = new File("/home/mdecorde/TXM/corpora/BVHEPISTEMON2016/tokenized/1538_MarotAdole.xml")
+		File outputFile = new File("/home/mdecorde/TEMP/tmp.xml")
+
+		MileStoneProjection msp = new MileStoneProjection(inputFile, "body", "w", "lb");
+		println "Sucess: "+msp.process(outputFile)
+	}
+}
Index: tmp/org.txm.core/src/java/org/txm/importer/StaxParser.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/StaxParser.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/StaxParser.groovy	(revision 881)
@@ -0,0 +1,165 @@
+package org.txm.importer
+
+import groovy.transform.CompileStatic
+import java.io.File;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamWriter;
+import java.net.URL;
+import javax.xml.stream.*;
+import org.txm.importer.filters.*;
+import org.txm.importer.PersonalNamespaceContext;
+
+@CompileStatic
+class StaxParser {
+
+	protected URL inputurl;
+	protected InputStream inputData;
+	protected XMLInputFactory factory;
+	protected XMLStreamReader parser;
+	
+	
+	protected static PersonalNamespaceContext Nscontext = new PersonalNamespaceContext();
+	
+	protected String localname;
+	
+	public StaxParser(File infile)
+	{
+		this(infile.toURI().toURL());
+	}
+	
+	public StaxParser(URL inputurl)
+	{
+		this.inputurl = inputurl;
+		inputData = inputurl.openStream();
+		factory = XMLInputFactory.newInstance();
+		
+		parser = factory.createXMLStreamReader(inputData);
+	}
+	
+	protected void before()
+	{
+		
+	}
+	
+	protected void after()
+	{
+		factory = null;
+		if (parser !=null) parser.close();
+		parser = null;
+	}
+	
+	protected void closeForError() {
+		parser.close();
+	}
+
+	public boolean process()
+	{
+		try {
+			for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+				switch (event) {
+					case XMLStreamConstants.NAMESPACE:
+						processNamespace();
+						break;
+					case XMLStreamConstants.START_ELEMENT:
+						localname = parser.getLocalName();
+						processStartElement();
+						break;		
+					case XMLStreamConstants.CHARACTERS:
+						processCharacters();
+						break;
+					case XMLStreamConstants.PROCESSING_INSTRUCTION:
+						processProcessingInstruction();
+						break;
+					case XMLStreamConstants.DTD:
+						processDTD();
+						break;
+					case XMLStreamConstants.CDATA:
+						processCDATA();
+						break;
+					case XMLStreamConstants.COMMENT:
+						processComment();
+						break;
+					case XMLStreamConstants.END_ELEMENT:
+						localname = parser.getLocalName();
+						processEndElement();	
+						break;
+					case XMLStreamConstants.END_DOCUMENT:
+						processEndDocument();
+						break;
+					case XMLStreamConstants.ENTITY_REFERENCE:
+						processEntityReference();
+						break;
+				}
+			}
+		} catch(Exception e) {
+			println("Unexpected error while parsing file "+inputurl+" : "+e);
+			println("Location line: "+parser.getLocation().getLineNumber()+" character: "+parser.getLocation().getColumnNumber());
+			org.txm.utils.logger.Log.printStackTrace(e);
+			parser.close();
+			return false;
+		}
+		
+		after(); // if you need to do something before closing the parser();
+		return true;
+	}
+
+	public def getLocation() {
+		if (parser != null)
+			return "Line: "+parser.getLocation().getLineNumber()+" Col: "+parser.getLocation().	getColumnNumber()
+		return null;
+	}
+	
+	protected void processNamespace() {
+	}
+	
+	protected void processStartElement()
+	{
+	}
+
+	protected void processCharacters()
+	{
+	}
+	
+	protected void processProcessingInstruction()
+	{
+	}
+	
+	protected void processDTD()
+	{
+	}
+	
+	protected void processCDATA()
+	{
+	}
+	
+	protected void processComment()
+	{
+	}
+	
+	protected void processEndElement()
+	{
+	}
+	
+	protected void processEndDocument() {
+	}
+	
+	protected void processEntityReference() {
+	}
+	
+	public static void main(String[] args)
+	{
+		File input = new File("/home/mdecorde/xml/xiinclude/master.xml")
+		File output = new File("/home/mdecorde/xml/xiinclude/merged.xml")
+		if (!(input.exists() && input.canRead())) {
+			println "cannot found $input";
+			return;
+		}
+		def builder = new StaxParser(input.toURI().toURL());
+		if (builder.process()) {
+			println "success ? "+ValidateXml.test(output);
+		} else {
+			println "failure !"
+		}
+	}
+}
\ No newline at end of file
Index: tmp/org.txm.core/src/java/org/txm/importer/StaxStackWriter.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/StaxStackWriter.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/StaxStackWriter.groovy	(revision 881)
@@ -0,0 +1,259 @@
+package org.txm.importer
+
+import java.nio.charset.Charset;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.stream.*;
+
+import org.eclipse.core.runtime.Platform;
+
+public class StaxStackWriter implements XMLStreamWriter {
+
+	XMLStreamWriter writer;
+	OutputStream output;
+	def events = [];
+	
+	public StaxStackWriter(File file) {
+		this(new BufferedOutputStream(new FileOutputStream(file)));
+	}
+	
+	public StaxStackWriter(File file, String encoding) {
+		this(new BufferedOutputStream(new FileOutputStream(file)), encoding);
+	}
+	
+	public StaxStackWriter(OutputStream output) {
+		this(output, "UTF-8");//create a new file
+	}
+	
+	public StaxStackWriter(OutputStream output, String encoding) {
+		XMLOutputFactory factory = XMLOutputFactory.newInstance();
+		this.output = output
+		this.writer = factory.createXMLStreamWriter(output, encoding);//create a new file
+	}
+
+	Charset UTF8 = Charset.forName("UTF-8");
+	public void write(String txt) {
+		output.write(txt.getBytes(UTF8))
+	}
+	
+	public void writeEndElements() {
+		int size = events.size();
+		for (int i = 0 ; i < size ; i++) {
+			writeEndElement();
+		}
+		events = [];
+	}
+
+	public void writeStartElements(def tagsToWrite) {
+		for (String tag : tagsToWrite)
+			writeStartElement(tag);
+	}
+
+	public def getTagStack() {
+		return events;
+	}
+
+	@Override
+	public void close () throws XMLStreamException {
+		writer.close();
+		output.close();
+	}
+
+	@Override
+	public void flush () throws XMLStreamException {
+		writer.flush();
+
+	}
+
+	@Override
+	public NamespaceContext getNamespaceContext() {
+		return writer.getNamespaceContext();
+	}
+
+	@Override
+	public String getPrefix (String uri) throws XMLStreamException {
+		return writer.getPrefix(uri);
+	}
+
+	@Override
+	public Object getProperty (String name) throws IllegalArgumentException {
+		return writer.getProperty(name);
+	}
+
+	@Override
+	public void setDefaultNamespace (String uri) throws XMLStreamException {
+		writer.setDefaultNamespace(uri);
+	}
+
+	@Override
+	public void setNamespaceContext(NamespaceContext context)
+	throws XMLStreamException {
+		writer.setNamespaceContext(context);
+	}
+
+	@Override
+	public void setPrefix (String prefix, String uri) throws XMLStreamException {
+		writer.setPrefix(prefix, uri);
+	}
+
+	@Override
+	public void writeAttribute (String localName, String value) throws XMLStreamException {
+		writer.writeAttribute(localName, value);
+	}
+
+	@Override
+	public void writeAttribute (String namespaceURI, String localName, String value) throws XMLStreamException {
+		writer.writeAttribute(namespaceURI, localName, value);
+	}
+
+	@Override
+	public void writeAttribute (String prefix, String namespaceURI, String localName, String value) throws XMLStreamException {
+		writer.writeAttribute(prefix, namespaceURI, localName, value);
+	}
+
+	@Override
+	public void writeCData (String data) throws XMLStreamException {
+		writer.writeCData(data);
+	}
+
+	@Override
+	public void writeCharacters (String text) throws XMLStreamException {
+		writer.writeCharacters(text);
+	}
+
+	@Override
+	public void writeCharacters (char[] text, int start, int len) throws XMLStreamException {
+		writer.writeCharacters(text, start, len);
+	}
+
+	@Override
+	public void writeComment (String data) throws XMLStreamException {
+		writer.writeComment(data);
+	}
+
+	@Override
+	public void writeDTD (String dtd) throws XMLStreamException {
+		writer.writeDTD(dtd);
+	}
+
+	@Override
+	public void writeDefaultNamespace(String namespaceURI)
+	throws XMLStreamException {
+		writer.writeDefaultNamespace(namespaceURI);
+	}
+
+	public void writeElement (String localName, String text) throws XMLStreamException {
+		writer.writeStartElement(localName);
+		writer.writeCharacters(text);
+		writer.writeEndElement();
+	}
+	
+	public void writeElement (String localName, def map, String text) throws XMLStreamException {
+		writer.writeStartElement(localName);
+		for (def key : map.keySet()) writeAttribute(key.toString(), map[key].toString());
+		writer.writeCharacters(text);
+		writer.writeEndElement();
+	}
+
+	@Override
+	public void writeEmptyElement (String localName) throws XMLStreamException {
+		writer.writeEmptyElement(localName);
+	}
+
+	public void writeEmptyElement (String localName, def map) throws XMLStreamException {
+		writer.writeEmptyElement(localName);
+		for (def key : map.keySet())
+			writeAttribute(key.toString(), map[key].toString());
+	}
+
+	@Override
+	public void writeEmptyElement(String namespaceURI, String localName)
+	throws XMLStreamException {
+		writer.writeEmptyElement(namespaceURI, localName);
+	}
+
+	@Override
+	public void writeEmptyElement (String prefix, String localName, String namespaceURI) throws XMLStreamException {
+		writer.writeEmptyElement(prefix, localName, namespaceURI);
+	}
+
+	@Override
+	public void writeEndDocument () throws XMLStreamException {
+		writer.writeEndDocument();
+	}
+
+	@Override
+	public void writeEndElement () throws XMLStreamException {
+		writer.writeEndElement();
+		events.pop()
+
+	}
+
+	@Override
+	public void writeEntityRef (String name) throws XMLStreamException {
+		writer.writeEntityRef(name);
+	}
+
+	@Override
+	public void writeNamespace(String prefix, String namespaceURI)
+	throws XMLStreamException {
+		writer.writeNamespace(prefix, namespaceURI);
+	}
+
+	@Override
+	public void writeProcessingInstruction(String target)
+	throws XMLStreamException {
+		writer.writeProcessingInstruction(target);
+	}
+
+	@Override
+	public void writeProcessingInstruction(String target, String data)
+	throws XMLStreamException {
+		writer.writeProcessingInstruction(target, data);
+	}
+
+	@Override
+	public void writeStartDocument () throws XMLStreamException {
+		writer.writeStartDocument();
+
+	}
+
+	@Override
+	public void writeStartDocument (String version) throws XMLStreamException {
+		writer.writeStartDocument(version);
+	}
+
+	@Override
+	public void writeStartDocument(String encoding, String version)
+	throws XMLStreamException {
+		writer.writeStartDocument(encoding, version);
+	}
+
+	@Override
+	public void writeStartElement (String localName) throws XMLStreamException {
+		writer.writeStartElement(localName);
+		events << localName
+
+	}
+	
+	public void writeStartElement (String localName, def map) throws XMLStreamException {
+		writeStartElement(localName);
+		for (def key : map.keySet()) {
+			writeAttribute(key.toString(), map[key].toString());
+		}
+	}
+
+	@Override
+	public void writeStartElement(String namespaceURI, String localName)
+	throws XMLStreamException {
+		writer.writeStartElement(namespaceURI, localName);
+		events << localName
+	}
+
+	@Override
+	public void writeStartElement(String prefix, String localName,
+	String namespaceURI) throws XMLStreamException {
+		writer.writeStartElement(prefix, localName, namespaceURI);
+		events << localName
+	}
+}
Index: tmp/org.txm.core/src/java/org/txm/importer/RenameTag.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/RenameTag.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/RenameTag.groovy	(revision 881)
@@ -0,0 +1,154 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 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:$
+// $LastChangedRevision:$
+// $LastChangedBy:$
+//
+package org.txm.importer
+
+import java.io.File;
+
+import org.w3c.dom.Document;
+import java.io.File;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import javax.xml.parsers.*;
+import javax.xml.xpath.*;
+import javax.xml.transform.*;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import org.txm.importer.PersonalNamespaceContext;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class RenameTag : using Stax or DOM depending on the file size
+ */
+class RenameTag extends StaxIdentityParser{
+
+	public static int DOMMAXSIZE = 1000000;
+	String newname, oldname;
+	File xmlfile;
+
+	public RenameTag(File xmlfile, String oldname, String newname)
+	{
+		super(xmlfile.toURI().toURL());
+		this.oldname = oldname;
+		this.newname = newname;
+		this.xmlfile = xmlfile;
+	}
+	/**
+	 * Rename an element - DOM method
+	 *
+	 * @param xmlfile the xmlfile
+	 * @param oldname the oldname
+	 * @param newname the newname
+	 * @return true, if successful
+	 */
+	public static boolean rename(File xmlfile, String oldname, String newname)
+	{
+		if (!xmlfile.exists()) {
+			println "Error: $xmlfile does not exists"
+		}
+
+		if (!(xmlfile.canRead() && xmlfile.canWrite())) {
+			println "Error: $xmlfile is not readable or writable"
+		}
+
+		if (xmlfile.length() <= DOMMAXSIZE) {
+			String xpath = "//"+oldname;
+			DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
+			domFactory.setXIncludeAware(true);
+			domFactory.setNamespaceAware(true); // never forget this!
+			DocumentBuilder builder = domFactory.newDocumentBuilder();
+			Document doc = builder.parse(xmlfile);
+
+			XPathFactory xpathfactory = XPathFactory.newInstance();
+			def _xpath = xpathfactory.newXPath();
+			_xpath.setNamespaceContext(new PersonalNamespaceContext());
+			def expr = _xpath.compile(xpath);
+			def nodes = expr.evaluate(doc, XPathConstants.NODESET);
+
+			for(def node : nodes) {
+				doc.renameNode(node, null, newname)
+			}
+			return org.txm.utils.xml.DomUtils.save(doc, xmlfile)
+		}
+		else {
+			RenameTag builder = new RenameTag(xmlfile, oldname, newname);
+			File temp = File.createTempFile("temp", ".xml", xmlfile.getParentFile());
+			if(builder.process(temp)) {
+				if (!(xmlfile.delete() && temp.renameTo(xmlfile))) println "Warning can't rename file "+temp+" to "+xmlfile
+				return true;
+			}
+			else
+				return false;
+		}
+	}
+
+	/**
+	 * Rewrite processStartElement to update the localname if localname == oldname
+	 */
+	public void processStartElement()
+	{
+		String prefix = parser.getPrefix();
+		if (INCLUDE == localname && XI == prefix) {
+			processingXInclude();
+			return;
+		}
+
+		if (localname == oldname) {
+			localname = newname;
+
+			if(prefix.length() > 0)
+				writer.writeStartElement(Nscontext.getNamespaceURI(prefix), localname)
+			else
+				writer.writeStartElement(localname);
+
+			for(int i = 0 ; i < parser.getNamespaceCount() ; i++)
+			{
+				writer.writeNamespace(parser.getNamespacePrefix(i), parser.getNamespaceURI(i));
+			}
+
+			for(int i = 0 ; i < parser.getAttributeCount() ; i++)
+				writer.writeAttribute(parser.getAttributeLocalName(i), parser.getAttributeValue(i));
+		} else {
+			super.processStartElement();
+		}
+	}
+
+	public static void main(String[] args)
+	{
+		File xmlfile = new File("/home/mdecorde/xml/xmlçàé/essai.xml");
+		File temp = new File("/home/mdecorde/xml/xmlçàé/renamed.xml");
+		String oldname = "machin"
+		String newname = "titre"
+		long time = System.currentTimeMillis();
+		RenameTag.rename(xmlfile, oldname, newname);
+		//		RenameTag builder = new RenameTag(xmlfile, oldname, newname);
+		//		builder.process(temp);
+		println "elapsed: "+(System.currentTimeMillis()-time);
+	}
+}
Index: tmp/org.txm.core/src/java/org/txm/importer/AddAttributeValuesInXML.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/AddAttributeValuesInXML.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/AddAttributeValuesInXML.groovy	(revision 881)
@@ -0,0 +1,99 @@
+package org.txm.importer
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.txm.metadatas.Entry
+import org.txm.utils.Pair;
+
+/**
+ * Add a attribute value map in a XML file
+ * Warning: if an attribute already exists its value won't be changed
+ */
+class AddAttributeValuesInXML extends StaxIdentityParser {
+	File xmlFile;
+	String tag, attribute;
+	List<String> values;
+	HashMap<String, String> attributesMap;
+	boolean result;
+
+	public AddAttributeValuesInXML(File xmlFile, String tag, String attribute, List<String> values)
+	{
+		super(xmlFile.toURI().toURL());
+		this.xmlFile = xmlFile;
+		this.tag = tag;
+		this.attribute = attribute;
+		this.values = values;
+	}
+
+	public boolean process(File outfile) {
+		this.result = false;
+		boolean ret = super.process(outfile)
+		return this.result & ret;
+	}
+
+	/**
+	 * Rewrite the processStartElement() to update/add attributes
+	 */
+	int n = 0;
+	public void processStartElement()
+	{
+		if (localname != tag) {
+			super.processStartElement()
+		} else {
+			String prefix = parser.getPrefix();
+			if (INCLUDE == localname && XI == prefix) {
+				processingXInclude();
+				return;
+			}
+
+			if (prefix.length() > 0)
+				writer.writeStartElement(Nscontext.getNamespaceURI(prefix), localname)
+			else
+				writer.writeStartElement(localname);
+
+			for (int i = 0 ; i < parser.getNamespaceCount() ; i++) {
+				writer.writeNamespace(parser.getNamespacePrefix(i), parser.getNamespaceURI(i));
+			}
+
+			// get attributes
+			HashMap<String, String> attributes = new HashMap<String, String>();
+			for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+				attributes[parser.getAttributeLocalName(i)] = parser.getAttributeValue(i);
+			}
+			// add/update the value
+			if (n < values.size()) {
+				attributes[attribute] = values[n]; 
+			} else {
+				println "ERROR: not enough values to insert for file $xmlFile, at XML parser location: l="+parser.getLocation().getLineNumber()+",c="+parser.getLocation().getColumnNumber()+")."
+			}
+			n++
+			
+			// write attributes
+			for (def k : attributes.keySet()) {
+				writer.writeAttribute(k, attributes[k])
+			}
+		}
+	}
+	
+	@Override
+	public void after() {
+		super.after();
+		
+		if (n != values.size()) {
+			println "ERROR: number of $tag ("+n+") missmatch the number of values to insert: "+values.size()
+		}
+	}
+
+	public static void main(String[] args)
+	{
+		File xmlfile = new File("/home/mdecorde/xml/macroaddfacsattribute/src/test1.xml")
+		File temp = File.createTempFile("temp", ".xml", xmlfile.getParentFile());
+
+		AddAttributeValuesInXML builder = new AddAttributeValuesInXML(xmlfile, "pb", "facs", ["V1","V1.2", "V2", "V3"]);
+		builder.process(temp);
+		
+		println "Done"
+	}
+}
Index: tmp/org.txm.core/src/java/org/txm/importer/DisplayXmlTags.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/DisplayXmlTags.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/DisplayXmlTags.groovy	(revision 881)
@@ -0,0 +1,183 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 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: 2013-05-06 17:38:43 +0200 (lun. 06 mai 2013) $
+// $LastChangedRevision: 2386 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer;
+
+import java.util.HashMap;
+import java.util.ArrayList;
+import java.io.File;
+import javax.xml.stream.*;
+import java.net.URL;
+
+// TODO: Auto-generated Javadoc
+/** count and display the tags of an xml file. @author mdecorde */
+class DisplayXmlTags {
+	ArrayList<String> paths = new ArrayList<String>(); // contains the xpath of
+	// the tags
+	
+	/** The counts. */
+	HashMap<String, Integer> counts = new HashMap<String, Integer>(); // contains the counts per tag
+	
+	/** The chars. */
+	HashMap<String, Integer> chars = new HashMap<String, Integer>(); // contains the char counts per tag
+
+	/** The currentpath. */
+	String currentpath = "";
+	
+	/** The sum. */
+	public int sum = 0;
+
+	/**
+	 * Instantiates a new display xml tags.
+	 *
+	 * @param infile : the file to parse
+	 */
+	public DisplayXmlTags(File infile) {
+		if (infile.isDirectory()) {
+			for (File f : infile.listFiles()) {
+				processxmlFile(f);
+			}
+		} else
+			processxmlFile(infile);
+	}
+
+	/**
+	 * run the script.
+	 *
+	 * @param xmlfile the xmlfile
+	 * @return true, if successful
+	 */
+	private boolean processxmlFile(File xmlfile)
+	{
+		try
+		{
+			URL url = xmlfile.toURI().toURL();
+			def inputData = url.openStream();
+			def factory = XMLInputFactory.newInstance();
+			XMLStreamReader parser = factory.createXMLStreamReader(inputData);
+			for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) 
+			{
+				switch (event) 
+				{
+					case XMLStreamConstants.START_ELEMENT:
+					
+						currentpath += "/"+parser.getLocalName();// append the current tag to the current path
+						if(!paths.contains(currentpath))
+						{
+							paths.add(currentpath);
+							counts.put(currentpath, 0);
+							chars.put(currentpath, 0);
+						}
+						counts.put(currentpath, counts.get(currentpath)+1); // increment path count
+					
+						break;
+					case XMLStreamConstants.END_ELEMENT:
+						currentpath = currentpath.substring(0,currentpath.length() -1 - parser.getLocalName().length()) // remove tag from the path
+						break;
+					case XMLStreamConstants.CHARACTERS:
+						
+						chars.put(currentpath, chars.get(currentpath)+parser.getText().trim().length());
+						sum += parser.getText().trim().length();
+				}
+			}
+			
+		}
+		catch(Exception e){println("File "+xmlfile+"\n"+e); return false;}
+		return true;
+	}
+
+	/**
+	 * Gets the tag hierarchy.
+	 *
+	 * @return the hierarchy of the tags
+	 */
+	public ArrayList<String> getTagHierarchy() {
+		return paths;
+	}
+
+	/**
+	 * return the counts of a tag.
+	 *
+	 * @param path : the tag path (ex : /TEI/text/p")
+	 * @return the count
+	 */
+	public int getCount(String path) {
+		return counts.get(path);
+	}
+
+	/**
+	 * Gets the counts.
+	 *
+	 * @return all the tags counts
+	 */
+	public int getCounts() {
+		return counts;
+	}
+	
+	/**
+	 * return the counts of chars of  a tag.
+	 *
+	 * @param path : the tag path (ex : /TEI/text/p")
+	 * @return the char
+	 */
+	public int getChar(String path) {
+		return chars.get(path);
+	}
+
+	/**
+	 * Gets the chars.
+	 *
+	 * @return all the tags counts
+	 */
+	public int getChars() {
+		return chars;
+	}
+
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		String userhome = System.getProperty("user.home"); 
+		DisplayXmlTags diag = new DisplayXmlTags(new File(userhome, "xml/manuelTXM/Manuel_TEI_FR_0_5.xml"));
+		ArrayList<String> paths = diag.getPaths();
+		Collections.sort(paths);
+		if(paths != null)
+			for(String s : paths)
+			{
+				print s+" : "+diag.getCount(s);
+				if(diag.getChar(s) > 0)
+					print " (chars "+diag.getChar(s)+")";
+					
+				println ""
+			}
+		
+		println "total chars : "+diag.sum;
+	}
+}
Index: tmp/org.txm.core/src/java/org/txm/importer/GetPagesFromURL.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/GetPagesFromURL.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/GetPagesFromURL.groovy	(revision 881)
@@ -0,0 +1,74 @@
+package org.txm.importer
+
+import org.w3c.tidy.Tidy
+
+def workDir = new File("/home/mdecorde/TEMP")
+def outdir = new File("/home/mdecorde/TEMP/out")
+
+def src = "http://txm.sourceforge.net/doc/manual/manual1.xhtml";
+def base = src.substring(0, src.lastIndexOf("/"));
+
+def url_xpath = """//*/a[@href]/@href""";
+def url_regexp = /.+/;
+def duplicates = false; // 'true' not implemented
+def filename_regexp = /zer/;
+def content_xpath = "//*/div[@id=\"content\"]";
+
+def xhtmlFile = new File(workDir, "src.xhtml")
+URL2XHTMLFILE(src, xhtmlFile, workDir);
+
+println "finding urls of $xhtmlFile"
+XPathResult xpathResult = new XPathResult(xhtmlFile);
+def urls = new LinkedHashSet<String>();
+
+for (String url : xpathResult.getXpathResponses(url_xpath))
+	if (urls ==~ url_regexp ) urls << url
+println urls
+
+int i = 1;
+for (String url : urls) {
+	//url = url.replaceAll()
+	def subxHtmlFile = new File(workDir, url)
+	URL2XHTMLFILE(base+"/"+url, subxHtmlFile, workDir);
+	
+	def txtFile = new File(outdir, url+".xhtml")
+	def writer = txtFile.newWriter("UTF-8");
+	for (def node : xpathResult.getNodes(content_xpath)) {
+		writer.println(node)
+	}
+	writer.close()
+	i++
+}
+
+def URL2XHTMLFILE(String url, File outfile, File workDir) {
+	println "getting src: $url"
+	def htmlFile = new File(workDir, "base.html")
+	def filestream = new FileOutputStream(htmlFile)
+	def out = new BufferedOutputStream(filestream)
+	out << new URL(url).openStream()
+	out.close()
+	
+	println "xHTMLize HTML $htmlFile"
+	Tidy tidy = new Tidy(); // obtain a new Tidy instance
+	tidy.setXHTML(true); // set desired config options using tidy setters
+	tidy.setInputEncoding("UTF-8")
+	tidy.setOutputEncoding("UTF-8")
+	tidy.setShowErrors(0)
+	tidy.setTabsize(10)
+	tidy.setShowWarnings(false)
+	File xhtmlFile = new File(workDir, "base.xhtml")
+	xhtmlFile.withWriter("UTF-8") { out2 ->
+		tidy.parse(htmlFile.toURI().toURL().newInputStream([readTimeout: 10000]), out2); // run tidy, providing an input and output stream
+	}
+	
+	println "remove entities and doctype"
+	String text = xhtmlFile.getText("UTF-8")
+	text = text.replaceAll("&nbsp;", " ")
+	text = text.replaceAll("xmlns=\"http://www.w3.org/1999/xhtml\"", " ")
+	text = text.replaceAll("""<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">""", "")
+	outfile.withWriter("UTF-8") { writer ->
+		writer.write(text);
+	}
+}
+println "done"
\ No newline at end of file
Index: tmp/org.txm.core/src/java/org/txm/importer/Doc2Transcription.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/Doc2Transcription.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/Doc2Transcription.groovy	(revision 881)
@@ -0,0 +1,122 @@
+package org.txm.importer
+
+import javax.xml.stream.*
+import java.net.URL
+
+class Doc2Transcription {
+
+	String encoding
+	File txtfile
+	File outfile
+	Reader reader
+	XMLOutputFactory factory
+	FileOutputStream output
+	XMLStreamWriter writer
+
+	int noline = 1
+	boolean question = false
+	int idquestion = 1
+	int idresponse = 1
+	boolean opened = false
+
+	public Doc2Transcription(File txtfile, File outfile, String encoding)
+	{
+		this.txtfile = txtfile
+		this.outfile = outfile
+		this.encoding = encoding
+
+		reader = new InputStreamReader(new FileInputStream(txtfile) , encoding)
+		factory = XMLOutputFactory.newInstance()
+		output = new FileOutputStream(outfile)
+		writer = factory.createXMLStreamWriter(output, "UTF-8")//create a new file
+	}
+
+	public boolean process()
+	{
+		if(reader == null || writer == null)
+		{
+			println "I/O error"
+			return false
+		}
+		
+		// build text id
+		String filename = txtfile.getName()
+		int idx = filename.lastIndexOf(".")
+		if(idx > 0)
+			filename = filename.substring(0, idx)
+
+		//write Start doc
+		writer.writeStartDocument("UTF-8", "1.0")
+		writer.writeStartElement("text") // we create a tag <text>
+		writer.writeAttribute("id",filename)// and set its id
+
+		//write first block
+		writeStartQuestionResponse()
+		
+		String line = reader.readLine()
+		while(line != null)
+		{
+			if(line.length() == 0) // saut de ligne
+			{
+				question = !question
+				writer.writeEmptyElement("br")
+				writeStartQuestionResponse()
+			}
+			else
+			{
+				writer.writeCharacters(line+" \n")
+				writer.writeEmptyElement("br")
+			}
+
+			noline++
+			line = reader.readLine()
+		}
+
+		//close xml doc and question/response if needed
+		if(opened)
+			writer.writeEndElement()// question/response
+		writer.writeEndElement()// text
+
+		reader.close()
+		writer.close()
+		output.close()
+		return true
+	}
+
+	public void writeStartQuestionResponse()
+	{
+		if(opened)
+		{
+			writer.writeEndElement()
+			opened = false
+		}
+		opened = true
+		if(question)
+		{
+			writer.writeStartElement("question") // we create a tag <text>
+			writer.writeAttribute("id","q"+idquestion++)// and set its id
+		}
+		else
+		{
+			writer.writeStartElement("response") // we create a tag <text>
+			writer.writeAttribute("id","r"+idresponse++)// and set its id
+		}
+	}
+
+	public void setInitialeState(boolean state)
+	{
+		question = state
+	}
+
+	static main(args) {
+		File infile = new File("/home/matt/xml/txttranscription/test.txt")
+		File outfile = new File("/home/matt/xml/txttranscription/test.xml")
+		String encoding = "UTF-8"
+
+		def builder = new Doc2Transcription(infile, outfile, encoding)
+		if(builder.process())
+			println "ok"
+		else
+			println "fail"
+	}
+}
\ No newline at end of file
Index: tmp/org.txm.core/src/java/org/txm/importer/WriteIdAndNAttributes.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/WriteIdAndNAttributes.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/WriteIdAndNAttributes.groovy	(revision 881)
@@ -0,0 +1,231 @@
+package org.txm.importer
+
+class WriteIdAndNAttributes extends StaxIdentityParser {
+
+	String textname
+
+	int nMileStone = 1, nPb = 1, nCb = 1, nLb = 1, nW = 1, nSeg = 1, nRejet = 1;
+	String previousMileStone, previousPb, previousCb, previousW;
+
+
+	String PB = "pb", CB = "cb", LB = "lb", ID = "id", TYPE = "type",
+	N = "n", CORRESP = "corresp", FACS="facs", W="w", PC="pc", SEG="seg",
+	UNIT="unit", XML="xml", WP="wp", SURFACE="surface", POINT = ".", REJET ="rejet";
+
+	public WriteIdAndNAttributes(File xmlFile, String textname) {
+		super(xmlFile);
+
+		this.textname = textname
+	}
+
+	protected void writeAttributes() {
+		// do nothing
+	}
+
+	protected void processStartElement() {
+		String id = null
+		String n = null
+		String type = null
+		String corresp = null
+		String facs = null
+
+		for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+			if (parser.getAttributeLocalName(i) == ID) {
+				id = parser.getAttributeValue(i)
+			} else if (parser.getAttributeLocalName(i) == N) {
+				n = parser.getAttributeValue(i)
+			} else if (parser.getAttributeLocalName(i) == TYPE) {
+				type = parser.getAttributeValue(i)
+			} else if (parser.getAttributeLocalName(i) == CORRESP) {
+				corresp = parser.getAttributeValue(i)
+			} else if (parser.getAttributeLocalName(i) == FACS) {
+				facs = parser.getAttributeValue(i)
+			}
+		}
+
+		super.processStartElement(); // attributes are not written because super.writeAttributes() is not called
+
+		if (localname == "milestone" && parser.getAttributeValue(null, UNIT) == SURFACE) {
+			if (n == null) {
+				n = nMileStone
+			} else {
+				int tmp = Integer.parseInt(n)
+				if (nMileStone < tmp) {
+					nMileStone = tmp
+					n = tmp
+				} else {
+					n = nMileStone;
+				}
+			}
+
+			if (id == null) { // don't rewrite "id"
+				if (facs == null) {
+					println "Error: found milestone@type=\"surface\" with no @facs at "+parser.getLocation()
+					throw new Exception("no facs attribute")
+				}
+				if (facs.lastIndexOf(POINT) > 0) facs = facs.substring(0, facs.lastIndexOf(POINT))
+				previousMileStone = "surf_$textname"+"_"+facs
+				id = previousMileStone
+			} else {
+				previousMileStone = id
+			}
+
+			nMileStone++
+		} else if (localname == PB) {
+			if (n == null) {
+				n = nPb
+			} else {
+				try {
+					int tmp = Integer.parseInt(n)
+					if (nPb < tmp) {
+						nPb = tmp
+					} else {
+						n = nPb;
+					}
+				} catch(Exception e) { }
+			}
+
+			if (id == null) { // don't rewrite "id"
+				id = "page_${textname}_"+nPb
+				previousPb = "${textname}_"+nPb
+			} else {
+				previousPb = id
+			}
+
+			nRejet = nLb = nCb = 1
+			nPb++
+		} else if (localname == CB) {
+			if (n == null) {
+				n = nCb
+			} else {
+				try {
+					int tmp = Integer.parseInt(n)
+					if (nCb < tmp) {
+						nCb = tmp
+					} else {
+						n = nCb;
+					}
+				} catch(Exception e) { }
+			}
+
+			if (id == null) { // don't rewrite "id"
+				previousCb = "${previousPb}_"+nCb
+				id = "col_${previousPb}_"+nCb
+			} else {
+				previousCb = id
+			}
+
+			nLb = nRejet = 1
+			nCb++
+		} else if (localname == LB) {
+			if (n == null) {
+				if (REJET == type) {
+					println "Warning: no 'n' attribute provided for 'rejet' line break at "+parser.getLocation()
+				}
+				
+				n = nLb
+			} else {
+				if (REJET != type) {
+					try { // if n is numeric update nLgRelative
+						int tmp = Integer.parseInt(n)
+						nLb = tmp;
+					} catch(Exception e) {
+						// n is not numeric use it
+					}
+				}
+			}
+
+			if (id == null) { // don't rewrite "id"
+				if (REJET == type) {
+					id = "line_${previousCb}_"+n+"_r"+nRejet
+				} else {
+					id = "line_${previousCb}_"+n
+				}
+			}
+
+			if (corresp == null && REJET == type) {
+				//println "Warning: no 'corresp' attribute provided for 'rejet' line break at "+parser.getLocation()
+				corresp = "#line_${previousCb}_"+n; // next word id in the same column
+			}
+
+			if (REJET != type) {
+				nLb++;
+			} else {
+				nRejet++;
+			}
+
+		} else if (localname == W || localname == PC) {
+			if (n == null) {
+				n = nW
+			} else {
+				try {
+					int tmp = Integer.parseInt(n)
+					if (nW < tmp) {
+						nW = tmp
+					} else {
+						n = nW;
+					}
+				} catch(Exception e) { }
+			}
+
+			if (id == null) { // don't rewrite "id"
+				//previousW = "${previousPb}_"+nW
+				id = localname+"_${textname}_"+nW
+			} 
+			previousW = id
+			nSeg = 1
+			nW++
+		} else if (localname == SEG && WP == type) {
+			if (n == null) {
+				n = nSeg
+			} else {
+				try {
+					int tmp = Integer.parseInt(n)
+					if (nSeg < tmp) {
+						nSeg = tmp
+					} else {
+						n = nSeg;
+					}
+				} catch(Exception e) { }
+			}
+
+			if (id == null) { // don't rewrite "id"
+				id = "w_p_"+previousW+"_"+nSeg
+			}
+			nSeg++
+		}
+
+		// write attributes except ID, N and CORRESP
+		for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+			if (parser.getAttributeLocalName(i) == ID) {
+
+			} else if (parser.getAttributeLocalName(i) == N) {
+
+			}  else if (parser.getAttributeLocalName(i) == CORRESP) {
+
+			} else {
+				writeAttribute(parser.getAttributePrefix(i), parser.getAttributeLocalName(i), parser.getAttributeValue(i))
+			}
+		}
+		//if (localname == "lb") println "write id: "+["xml", "id", id]
+		if (id != null)
+			writeAttribute(XML, ID, id)
+		if (n != null)
+			writeAttribute(null, N, n)
+		if (corresp != null)
+			writeAttribute(null, CORRESP, corresp)
+	}
+
+	public static void main(String[] args) {
+		File xmlFile = new File("/home/mdecorde/xml/bugrejet/Psautier5-or28.xml")
+		File outFile = new File("/home/mdecorde/xml/bugrejet/Psautier5-or28-o.xml")
+
+		WriteIdAndNAttributes wiana = new WriteIdAndNAttributes(xmlFile, "qgraal_cm")
+		println wiana.process(outFile)
+
+		String text = xmlFile.getText().replaceAll(">", ">\n");
+		new File("/home/mdecorde/xml/bugrejet/Psautier5-or28-p.xml").write(text);
+		text = outFile.getText().replaceAll(">", ">\n");
+		new File("/home/mdecorde/xml/bugrejet/Psautier5-or28-o-p.xml").write(text);
+	}
+}
Index: tmp/org.txm.core/src/java/org/txm/importer/XPathResult.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/XPathResult.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/XPathResult.groovy	(revision 881)
@@ -0,0 +1,236 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 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: 2017-04-11 15:30:35 +0200 (mar. 11 avril 2017) $
+// $LastChangedRevision: 3426 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer;
+
+import org.txm.importer.PersonalNamespaceContext;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Iterator;
+import org.w3c.dom.*;
+import org.xml.sax.SAXException;
+
+import javax.xml.bind.helpers.DefaultValidationEventHandler;
+import javax.xml.parsers.*;
+import javax.xml.xpath.*;
+import javax.xml.stream.*;
+import java.net.URL;
+import java.util.Iterator;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class XPathResult.
+ *
+ * @authors ayepdieu, mdecorde, vchabanis
+ * 
+ * return the id of a bfm tag <milestone/>
+ */
+public class XPathResult {
+	
+	/** The doc. */
+	Document doc;
+	XPath xpath;
+
+	/**
+	 * Instantiates a new x path result.
+	 *
+	 * @param file the file
+	 */
+	public XPathResult(File xmlfile) {
+		this(xmlfile, true)
+	}
+	
+	/**
+	 * Instantiates a new x path result.
+	 *
+	 * @param file the file
+	 */
+	public XPathResult(File xmlfile, boolean namespaceAware) {
+		DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+		factory.setXIncludeAware(true);
+		factory.setNamespaceAware(namespaceAware); // never forget this!
+		
+		DocumentBuilder builder = factory.newDocumentBuilder();
+		doc = builder.parse(xmlfile);
+		
+		XPathFactory xfactory = XPathFactory.newInstance();
+		xpath = xfactory.newXPath();
+		xpath.setNamespaceContext(new PersonalNamespaceContext());
+	}
+	
+	public def getNodes(String query) {
+		def rnodes = [];
+		
+		XPathExpression expr = xpath.compile(query);
+		Object result = expr.evaluate(doc.getDocumentElement(), XPathConstants.NODESET);
+		
+		NodeList nodes = (NodeList) result;
+		for (int i = 0; i < nodes.getLength(); i++) {
+			rnodes.add(nodes.item(i));
+		}
+		return rnodes;
+	}
+	
+	public String getXpathResponse(String query) {
+		XPathExpression expr = xpath.compile(query);
+		Object result = expr.evaluate(doc.getDocumentElement(), XPathConstants.NODESET);
+		
+		NodeList nodes = (NodeList) result;
+		for (int i = 0; i < nodes.getLength(); i++) {
+			//println nodes.item(i)
+			return (nodes.item(i).getNodeValue());
+		}
+	}
+	
+	public ArrayList<String> getXpathResponses(String query) {
+		ArrayList<String> xresult = new ArrayList<String>();
+		XPathExpression expr = xpath.compile(query);
+		Object result = expr.evaluate(doc.getDocumentElement(), XPathConstants.NODESET);
+		
+		NodeList nodes = (NodeList) result;
+		for (int i = 0; i < nodes.getLength(); i++) {
+			//println nodes.item(i)
+			xresult.add((nodes.item(i).getNodeValue()));
+		}
+		return xresult
+	}
+	
+	public String getXpathResponse(String query, String devaultValue) {
+		String rez = getXpathResponse(query);
+		if (rez == null)
+			return devaultValue;
+		return rez;
+	}
+	
+	public void close() {
+		xpath = null;
+		doc = null;
+	}
+
+	/**
+
+	 * OBSOLETE VERSION FOR TXM return the node text content given a XPath
+
+	 * "//path.../.../@attr"
+	 * 
+	 * @param path
+	 * @param attr
+	 *            null or "" return the text of the tag targeted
+	 * @return
+	 */
+	/*
+	 * public String getXpathResponse(String path, String attr) throws
+	 * ParserConfigurationException, SAXException, IOException,
+	 * XPathExpressionException { String Query = path;
+	 * 
+	 * //println "XPath : "+Query; XPathFactory factory =
+	 * XPathFactory.newInstance(); XPath xpath = factory.newXPath();
+	 * xpath.setNamespaceContext(new PersonalNamespaceContext());
+	 * XPathExpression expr = xpath.compile(Query);
+	 * 
+	 * Object result = expr.evaluate(doc, XPathConstants.NODESET); // don't work
+	 * on windows NodeList nodes = (NodeList) result; //println
+	 * "result xpath : "+nodes.getLength(); for(int i = 0 ; i <
+	 * nodes.getLength() ; i++) { //println
+	 * "item : "+nodes.item(i).getLocalName(); if(attr != null &&
+	 * !attr.equals("")) return
+	 * nodes.item(i).getAttributes().getNamedItem(attr).getNodeValue(); else
+	 * return nodes.item(i).getTextContent();
+	 * 
+	 * } return ""; }
+	 */
+	
+	static public String getXpathResponse(File xmlfile, String query, String devaultValue) {
+		String rez = getXpathResponse(xmlfile, query);
+		if (rez == null)
+			return devaultValue;
+		return rez;
+	}
+	
+	static public String getXpathResponse(File xmlfile, String query, String devaultValue, boolean namespaceAware) {
+		String rez = getXpathResponse(xmlfile, query, namespaceAware);
+		if (rez == null)
+			return devaultValue;
+		return rez;
+	}
+
+	/**
+	 * Gets the xpath response.
+	 *
+	 * @param xmlfile the xmlfile
+	 * @param query the query
+	 * @return the xpath response
+	 */
+	static public String getXpathResponse(File xmlfile, String query) {
+		return getXpathResponse(xmlfile, query, true);
+	}
+	
+	/**
+	 * Gets the xpath response.
+	 *
+	 * @param xmlfile the xmlfile
+	 * @param query the query
+	 * @return the xpath response
+	 */
+	static public String getXpathResponse(File xmlfile, String query, boolean namespaceAware) {
+		XPathResult result = new XPathResult(xmlfile);
+		return result.getXpathResponse(query);
+//		DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+//		factory.setNamespaceAware(namespaceAware); // never forget this!
+//		
+//		DocumentBuilder builder = factory.newDocumentBuilder();
+//		Document doc = builder.parse(xmlfile);
+//		
+//		XPathFactory xfactory = XPathFactory.newInstance();
+//		XPath xpath = xfactory.newXPath();
+//		xpath.setNamespaceContext(new PersonalNamespaceContext());
+//		
+//		XPathExpression expr = xpath.compile(query);
+//		Object result = expr.evaluate(doc, XPathConstants.NODESET);
+//		
+//		NodeList nodes = (NodeList) result;
+//		println "size: "+result.getLength()
+//		for (int i = 0; i < nodes.getLength(); i++) {
+//			return (nodes.item(i).getNodeValue());
+//		}
+	}
+
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args) {
+		println("main of XPathResult")
+		File xmlFile = new File("/home/mdecorde/TXM/corpora/superphenix/txm/SUPERPHENIX/CreysSuper_04_0175.xml")
+		String value = XPathResult.getXpathResponse(xmlFile, "TEI/text/@date");
+		println "value: $value"
+		//value = XPathResult.getXpathResponse(new File("/home/mdecorde/xml/bfm/strasb.xml"), "tei:TEI/tei:teiHeader/tei:revisionDesc/tei:change[contains(.,'étiquetage morpho')]");
+		//println "value: $value"
+	}
+}
\ No newline at end of file
Index: tmp/org.txm.core/src/java/org/txm/importer/HTMLIndexer.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/HTMLIndexer.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/HTMLIndexer.groovy	(revision 881)
@@ -0,0 +1,167 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 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:$
+// $LastChangedRevision:$
+// $LastChangedBy:$ 
+//
+package org.txm.importer
+
+import java.util.Collections;
+import java.io.File;
+import org.txm.utils.io.FileCopy;
+import org.txm.utils.*;
+import java.io.File;
+import java.util.HashMap;
+import java.util.ArrayList;
+import java.io.File;
+import javax.xml.stream.*;
+import java.net.URL;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class HTMLIndexer.
+ */
+class HTMLIndexer {
+	
+	/** The idxprefix. */
+	static String idxprefix = "IDX-";
+	
+	/** The index. */
+	HashMap<String, ArrayList<String>> index = new HashMap<String, ArrayList<String>>();
+	
+	/**
+	 * Process html dir.
+	 *
+	 * @param htmlDirectory the html directory
+	 * @return true, if successful
+	 */
+	private boolean processHTMLDir(File htmlDirectory)
+	{
+		ArrayList<File> htmlfiles = DeleteDir.scanDirectory(htmlDirectory, true)
+		Collections.sort(htmlfiles);
+		
+		for(File htmlFile : htmlfiles)//get all indexes
+		{
+			if(htmlFile.getName().endsWith(".html"))
+				processHTMLFile(htmlFile);
+		}
+		
+		ArrayList<String> tokens = new ArrayList<String>(index.keySet());
+		Collections.sort(tokens);
+		
+		//fix doubles like étiquette&étiquettes
+		for(int i = 0 ; i < tokens.size() ; i++)
+		{
+			String t1 = tokens.get(i);
+			String t2 = tokens.get(i+1);
+			if(t1.equals(t2.substring(0, t2.length() -1)))
+			{
+				tokens.remove(i+1);
+				index.get(t1).addAll(index.get(t2));
+				//i--;
+			}
+		}
+		
+		tokens = new ArrayList<String>(index.keySet());
+		for(String token : tokens)
+		{
+			println("Token: "+token);
+			println(index.get(token));
+		}
+	}
+	
+	/**
+	 * Process html file.
+	 *
+	 * @param htmlFile the html file
+	 * @return true, if successful
+	 */
+	private boolean processHTMLFile(File htmlFile)
+	{
+		
+		
+		String lasttoken;
+		String page;
+		
+		try
+		{
+			URL url = htmlFile.toURI().toURL();
+			println "process html file "+url;
+			def inputData = url.openStream();
+			def factory = XMLInputFactory.newInstance();
+			//factory.setXMLResolver resolver
+			//factory.setProperty(factory.IS_VALIDATING, false)
+			factory.setProperty("javax.xml.stream.supportDTD", false);
+			factory.setProperty("javax.xml.stream.isReplacingEntityReferences", false);
+			
+			XMLStreamReader parser = factory.createXMLStreamReader(inputData);
+			for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) 
+			{
+				//println "parse"
+				switch (event) 
+				{
+					case XMLStreamConstants.START_ELEMENT:
+						//println "elem "+parser.getLocalName()
+						if(parser.getLocalName() == "div")
+							if(parser.getAttributeValue(null, "id") != null && parser.getAttributeValue(null, "id").startsWith("index-body"))
+								page = parser.getAttributeValue(null, "id")
+								
+						String id = parser.getAttributeValue(null, "id");
+						if(id != null && id.startsWith(idxprefix))
+						{
+							if(!index.containsKey(lasttoken))
+								index.put(lasttoken, new ArrayList<String>());
+							index.get(lasttoken).add(htmlFile.getName()+"#"+id)
+						}
+					
+						break;
+					
+					case XMLStreamConstants.CHARACTERS:
+						String text = parser.getText().trim();
+						if(text.length() > 0)
+						{
+							def texts = text.split(" ");
+							lasttoken = texts[texts.size()-1];
+							if(lasttoken.endsWith("."))
+								lasttoken = lasttoken.substring(0, lasttoken.length() -1)
+						}
+				}
+			}
+			
+		}
+		catch(Exception e){println("File "+htmlFile+"\n"+e); return false;}
+		return true;
+	}
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		File htmlDirectory = new File("/home/mdecorde/xml/html")
+		new HTMLIndexer().processHTMLDir(htmlDirectory);
+	}
+}
Index: tmp/org.txm.core/src/java/org/txm/importer/WriteIdAndNAttributesUltraGeneric.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/WriteIdAndNAttributesUltraGeneric.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/WriteIdAndNAttributesUltraGeneric.groovy	(revision 881)
@@ -0,0 +1,141 @@
+package org.txm.importer
+
+class WriteIdAndNAttributesUltraGeneric extends StaxIdentityParser {
+
+	String baseID = ""
+	def rules = [];
+
+	def idCounters = [:]
+	def nCounters = [:]
+	def parentIds = [:]
+	
+	def elements;
+	def elementShortNames
+	def elementParents
+	def elementResets
+	def elementSelection
+	public WriteIdAndNAttributesUltraGeneric(File xmlFile, def elements, def elementSelection, def elementShortNames, def elementParents, def elementResets) {
+		super(xmlFile)
+		
+		this.elements = elements;
+		this.elementSelection = elementSelection
+		this.elementShortNames = elementShortNames;
+		this.elementParents = elementParents
+		this.elementResets = elementResets
+		
+		this.baseID = xmlFile.getName();
+		if (baseID.indexOf(".") > 0) baseID = baseID.substring(0, baseID.indexOf("."))
+		
+		for (String element : elements) {
+			idCounters[element] = 1;
+			nCounters[element] = 1;
+			parentIds[element] = null;
+		}
+	}
+
+	/**
+	 * Special rule to add @corresp=#ref to its reference element to element which @attribute=@value
+	 */
+	public setReferenceRule(String element, String attribute, String value) {
+		this.rules << [element, attribute, value]
+	}
+	
+	protected void writeAttributes() {
+		if (!idCounters.containsKey(localname) ) {
+			super.writeAttributes();
+			return;
+		} 
+		println "write attributes $localname"
+		boolean idFound = false
+		boolean nFound = false
+		
+		
+		for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+			String name = parser.getAttributeLocalName(i);
+			String value = parser.getAttributeValue(i);
+			
+			println " at $name=$value"
+			
+			//String element_sign = [localname, name, value]
+			
+			if ("id" == name) {
+				if (value == null) {
+					value = getNextID()
+				} 
+				
+				parentIds[localname] = value
+			} else if ("n" == name) {
+				if (value == null) {
+					value = getNextN()
+				} else {
+					nCounters[localname] = Integer.parseInt(value)
+				}
+			}
+			
+			String attrPrefix = parser.getAttributePrefix(i);
+			if (attrPrefix != null && attrPrefix.length() > 0)
+				writer.writeAttribute(attrPrefix+":"+name, value);
+			else
+				writer.writeAttribute(name, value);
+		}
+		
+		if (!idFound) {
+			String value = getNextID()
+			writer.writeAttribute("id", value);
+			parentIds[localname] = value
+		}
+		if (!nFound) {
+			String value = getNextN()
+			writer.writeAttribute("n", value);
+		}
+		
+		
+		idCounters[localname]++
+	}
+	
+	protected void processStartElement() {
+		
+		if (idCounters.containsKey(localname)) {
+			println "Element: "+localname
+			for (String resetElement : elementResets[localname]) {
+				println "reset N: "+resetElement
+				nCounters[resetElement] = 1
+			}
+		}
+		
+		super.processStartElement();
+	}
+	
+	protected String getNextID() {
+		String value = elementShortNames[localname]
+		
+		String parent = elementParents[localname]
+		if (parent != null)
+			value += "_"+parentIds[parent]
+		else
+			value += "_"+baseID
+			
+		value += "-"+idCounters[localname]
+		
+		return value
+	}
+	
+	protected String getNextN() {
+		String value = Integer.toString(nCounters[localname])
+		nCounters[localname]++
+		return value
+	}
+	
+	public static void main(String[] args) {
+		File xmlFile = new File("/home/mdecorde/TEMP/idnmissing.xml")
+		File outFile = new File("/home/mdecorde/TEMP/idnmissing-fix.xml")
+		
+		WriteIdAndNAttributesUltraGeneric wiana = new WriteIdAndNAttributesUltraGeneric(xmlFile, 
+			["milestone", "pb", "cb", "lb"],
+			["milestone":"unit=surface", "pb":null, "cb":null, "lb":null],
+			["milestone":"surf", "pb":"page", "cb":"col", "lb":"line"], 
+			["milestone":null, "pb":null, "cb":"pb", "lb":"cb"],
+			["milestone":[], "pb":["cb", "lb"], "cb":[ "lb"], "lb":[]])
+		println wiana.process(outFile)
+	}
+}
Index: tmp/org.txm.core/src/java/org/txm/importer/Hyperbase2Xml.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/Hyperbase2Xml.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/Hyperbase2Xml.groovy	(revision 881)
@@ -0,0 +1,184 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 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: 2017-06-26 16:53:47 +0200 (lun. 26 juin 2017) $
+// $LastChangedRevision: 3451 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer
+
+import org.txm.utils.CharsetDetector
+import org.txm.utils.i18n.DetectBOM;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStreamReader;
+
+import javax.xml.stream.*;
+import java.net.URL;
+
+// TODO: Auto-generated Javadoc
+/**
+ * Create a xml file per text declared in a Hyperbase file (old format).
+ *
+ * @author mdecorde
+ */
+class Hyperbase2Xml {
+	
+	/**
+	 * Run.
+	 *
+	 * @param infile the hyperbase file (old format)
+	 * @param outdir where the xml files are created
+	 * @param encoding the encoding of the hyperbase file
+	 * @return true, if successful
+	 */
+	public boolean run(File infile, File outdir, String encoding)
+	{
+		if (encoding == "??") {
+			encoding = new CharsetDetector(infile).getEncoding();
+			println "Guessing encoding of $infile : $encoding"
+		}
+		outdir.mkdir();
+		
+		String textname = null
+		String partname = null;
+		int textcount = 1;
+		def input = new FileInputStream(infile)
+		Reader reader = new InputStreamReader(input , encoding);
+		DetectBOM bomdetector = new DetectBOM(infile);
+		for (int ibom = 0 ; ibom < bomdetector.getBOMSize() ; ibom++) input.read()
+		
+		XMLOutputFactory factory = XMLOutputFactory.newInstance();
+		BufferedOutputStream output = null;
+		XMLStreamWriter writer = null;
+		
+		boolean firsttext=true;
+		
+		String line = reader.readLine();
+		while(line != null) {
+			line = CleanFile.clean(line);
+			if ((line.startsWith("&&&"))) // text declaration &&& longtitle, title, shorttitle &&&
+			{
+				if (partname != null) // close previous part
+				{
+					//println("close last part")
+					writer.writeEndElement();
+					partname= null;
+				}
+				if (textname != null) // close previous text
+				{
+					//println("close text "+textname)
+					writer.writeEndElement();
+					writer.close();
+					output.close();
+				}
+				textname = line.substring(3, line.length()-3);
+				if (textname.contains(","))
+				{
+					String[] textnames = textname.split(",");
+					if(textnames.length > 1)
+						textname = textnames[1].trim();
+					
+				}
+				// create a new text
+				output = new BufferedOutputStream(new FileOutputStream(new File(outdir,textname+".xml")))
+				writer = factory.createXMLStreamWriter(output, "UTF-8");
+				writer.writeStartElement("text");
+				writer.writeAttribute("id",textname);
+				println "text : "+new File(outdir,textname+".xml");
+			}
+			else if((line.startsWith("%%%%"))) // an other type of text declaration
+			{
+				if(partname != null)
+				{
+					//println("close last part")
+					writer.writeEndElement();
+					partname= null;
+				}
+				if(textname != null)
+				{
+					//println("close text "+textname)
+					writer.writeEndElement();
+					writer.close();
+					output.close();
+				}
+				textname = infile.getName().substring(0, infile.getName().length()-4)+(textcount++);
+				output =  new BufferedOutputStream(new FileOutputStream(new File(outdir,textname+".xml")))
+				writer = factory.createXMLStreamWriter(output, "UTF-8");
+				writer.writeStartElement("text");
+				writer.writeAttribute("id",textname);
+				println "text : "+new File(outdir,textname+".xml");
+			}
+			else if((line.startsWith("\$"))) // paragraph declaration
+			{
+				if(partname != null)
+				{
+					//println("close part "+partname)
+					writer.writeEndElement();
+				}
+				partname = line.substring(1);
+				
+				writer.writeStartElement("p");
+				writer.writeAttribute("id",partname);
+			}
+			else // brut text > write chars
+			{
+				if(writer != null)
+					writer.writeCharacters(line+"\n");
+			}
+			line = reader.readLine();
+		}
+		
+		if(partname != null)
+		{
+			//println("close last part")
+			writer.writeEndElement();
+		}
+		if(writer != null)
+			writer.writeEndElement();
+		
+		reader.close();
+		if(output != null)
+			output.close();
+		
+		return true;
+	}
+	
+	/**
+	 * Main.
+	 *
+	 * @param args the args
+	 */
+	static main(args) 
+	{
+		File infile = new File(System.getProperty("user.home")+"/xml/presdiscfra/src/PresDiscFranc");
+		File outfile = new File(System.getProperty("user.home")+"/xml/presdiscfra/split/");
+		new Hyperbase2Xml().run(infile, outfile,"ISO-8859-1");
+		println "done"
+	}
+}
Index: tmp/org.txm.core/src/java/org/txm/importer/HasElement.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/HasElement.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/HasElement.groovy	(revision 881)
@@ -0,0 +1,67 @@
+package org.txm.importer
+
+import javax.xml.stream.*;
+import java.net.URL;
+
+/**
+ * Check if a file contains a tag
+ * @author mdecorde
+ *
+ */
+class HasElement {
+
+	HashSet<String> localnames = new HashSet<String>();
+	File xmlfile;
+	XMLStreamReader parser;
+	HashMap<String, Boolean> elements = [:];
+
+	public HasElement(File xmlfile, String localname) {
+		localnames << localname;
+		this.xmlfile = xmlfile;
+		elements[localname] = false;
+
+		init();
+	}
+
+	private void init() {
+		try {
+			
+//			println "xmlfile: "+xmlfile
+//			println "xmlfile exists: "+xmlfile.exists()
+//			println "uri: "+ xmlfile.toURI()
+//			println "url: "+ xmlfile.toURI().toURL()
+//			
+			def inputData = xmlfile.toURI().toURL().openStream();
+			def inputFactory = XMLInputFactory.newInstance();
+			parser = inputFactory.createXMLStreamReader(inputData);
+		} catch (Exception ex) {
+			System.out.println("IOException while parsing: "+ex);
+			ex.printStackTrace();
+		}
+	}
+
+	public boolean process() {
+		if (parser == null) return false;
+		
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			if (event == XMLStreamConstants.START_ELEMENT) {
+				String localname = parser.getLocalName();
+				if (localnames.contains(localname)) {
+					parser.close();
+					return true;
+				}
+			}
+		}
+		parser.close();
+	}
+	
+	public static void main(String[] args) {
+		File dir = new File("/home/mdecorde/xml/lamoplat")
+		println dir.listFiles()
+		for (File xmlfile : dir.listFiles()) {
+			if (!xmlfile.getName().endsWith(".xml")) continue
+			//println xmlfile
+			println "$xmlfile: "+ new HasElement(xmlfile, "text").process();
+		}
+	}
+}
Index: tmp/org.txm.core/src/java/org/txm/importer/SplitBy.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/SplitBy.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/SplitBy.groovy	(revision 881)
@@ -0,0 +1,204 @@
+package org.txm.importer
+
+import java.io.Writer;
+import java.io.File;
+import javax.xml.stream.*;
+import java.net.URL;
+import org.txm.importer.filters.*;
+
+class SplitBy 
+{
+	
+	XMLOutputFactory factory = XMLOutputFactory.newInstance();
+	FileOutputStream output;
+	XMLStreamWriter writer;
+	def parser;
+	ArrayList<String> newfiles = [];
+	
+	public SplitBy(File xmlfile)
+	{
+		try {
+			def inputData = xmlfile.toURI().toURL().openStream();
+			def inputFactory = XMLInputFactory.newInstance();
+			parser = inputFactory.createXMLStreamReader(inputData);
+			
+		} catch (XMLStreamException ex) {
+			System.out.println(ex);
+		}catch (IOException ex) {
+			System.out.println("IOException while parsing ");
+		}
+	}
+	boolean inby = false;
+	public boolean process(File outdir, String by, String idAttribute)
+	{
+		outdir.mkdirs();
+		try
+		{
+			for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+				
+				switch(event)
+				{
+					case XMLStreamConstants.START_ELEMENT:
+						if(parser.getLocalName() == by)
+						{
+							
+							inby = true;
+							if(writer != null)
+							{
+								writer.close();
+								output.close();
+							}
+							
+							String filename = "";
+							for(int i = 0 ; i < parser.getAttributeCount(); i++)
+								if(parser.getAttributeLocalName(i) == idAttribute)
+								{
+									filename = parser.getAttributeValue(i);
+									break;
+								}
+							File newfile = new File(outdir,filename+".xml")
+							if(files.contains(newfile))
+							{
+								println "Item declared twice "+filename+" at location "+parser.getLocation();
+								return false;
+							}
+							files.add(newfile);
+							output = new FileOutputStream(newfile)
+							writer = factory.createXMLStreamWriter(output, "UTF-8");//create a new file
+							
+						}
+						if(writer != null)
+						{
+							writeEvent(event);
+							if(parser.getLocalName() == "TEI")
+							{ // write namespaces
+								writer.writeNamespace("tei", "http://www.tei-c.org/ns/1.0")
+								writer.writeNamespace("txm", "http://textometrie.org/1.0")
+							}
+						}
+						break;
+					case XMLStreamConstants.END_ELEMENT:
+						if(inby)
+						{
+							if(writer != null)
+							{
+								writer.writeEndElement();
+							}
+						}
+						if(parser.getLocalName() == by)
+						{
+							inby = false; // write the end element $by before
+						}
+						break;
+					case XMLStreamConstants.CHARACTERS:
+						if(writer != null)
+						{
+							writer.writeCharacters(parser.getText());
+						}
+						break;
+				}
+				
+			}
+			if(writer != null)
+				writer.close();
+			if(output != null)
+				output.close();
+			return true;
+		}
+		catch(Exception e){
+			println "XML Error at location: "+parser.getLocation()
+			e.printStackTrace()
+			if(writer != null)
+				writer.close()
+				output.close()
+				return false
+			}
+	}
+	
+	/**
+	 * write the current event.
+	 *
+	 * @param event the stax event
+	 */
+	private void writeEvent(int event)
+	{
+		def prefix = parser.getPrefix();
+		if (event == XMLStreamConstants.START_ELEMENT ) 
+		{
+			def localname = parser.getLocalName(); // write element
+			if (prefix != null && prefix.length() > 0)
+				writer.writeStartElement(prefix+":"+localname);
+			else
+				writer.writeStartElement(localname);
+			
+			for(int i = 0 ; i < parser.getNamespaceCount() ; i++) //write namespaces
+			{
+				writer.writeNamespace(parser.getNamespacePrefix(i), parser.getNamespaceURI(i));
+			}
+			
+			String attrprefix; // write attributes
+			for (int i = 0 ; i < parser.getAttributeCount() ; i++)
+			{
+				attrprefix = parser.getAttributePrefix(i);
+				if (attrprefix != null & attrprefix.length() > 0)
+					writer.writeAttribute(attrprefix+":"+parser.getAttributeLocalName(i), parser.getAttributeValue(i))
+				else
+					writer.writeAttribute(parser.getAttributeLocalName(i), parser.getAttributeValue(i))
+			}
+			//writer.writeCharacters("\n");
+		}
+		else if (event == XMLStreamConstants.END_ELEMENT)
+		{
+			writer.writeEndElement();
+			//writer.writeCharacters("\n");
+		}
+		else if (event == XMLStreamConstants.CHARACTERS)
+		{
+			writer.writeCharacters(parser.getText());
+		}
+		else if (event == XMLStreamConstants.COMMENT)
+		{
+			writer.writeComment(parser.getText());
+		}
+	}
+	
+	public ArrayList<File> getFiles()
+	{
+		return newfiles;
+	}
+	
+	public static void main(String[] args)
+	{
+		File xmlfile = new File("C:\\Documents and Settings\\mdecorde\\Bureau\\MISAT2011\\corpus\\tiempo\\ELTIEMPO.2002-2010.MIN.xml");
+		File okfile = new File("C:\\Documents and Settings\\mdecorde\\Bureau\\MISAT2011\\corpus\\tiempo\\");
+		File outdir = new File("C:\\Documents and Settings\\mdecorde\\Bureau\\MISAT2011\\corpus\\tiempo\\tiempo");
+		outdir.deleteDir();
+		outdir.mkdir();
+		
+		//		Reader reader = new InputStreamReader(new FileInputStream(xmlfile) , "ISO-8859-1");
+		//		Writer writer = new OutputStreamWriter(new FileOutputStream(okfile) , "UTF-8");
+		//		String line = reader.readLine();
+		//		while(line != null)
+		//		{
+		//			line = line.replaceAll(' ([a-zA-Z0-9]+)="(.*)""', ' $1="$2"')
+		//			writer.write(line+"\n");
+		//			line = reader.readLine();
+		//		}
+		//		reader.close();
+		//		writer.close();
+		//		
+		//		
+		////		if(!ValidateXml.test(okfile))
+		////		{
+		////			println "XML not valid";
+		////			return;
+		////		}
+		
+		def splitter = new SplitBy(xmlfile);
+		if(splitter.process(outdir, "texte", "id"))
+			println "success";
+		else
+			println "failed !"
+		
+	}
+}
Index: tmp/org.txm.core/src/java/org/txm/importer/RemoveTag.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/RemoveTag.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/RemoveTag.groovy	(revision 881)
@@ -0,0 +1,120 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 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:$
+// $LastChangedRevision:$
+// $LastChangedBy:$ 
+//
+package org.txm.importer;
+
+import javax.xml.parsers.*
+import javax.xml.transform.*
+import javax.xml.transform.dom.DOMSource
+import javax.xml.transform.stream.StreamResult
+import javax.xml.xpath.*
+
+import org.txm.metadatas.*
+import org.txm.utils.*
+import org.w3c.dom.Document
+import org.w3c.dom.Element
+
+/**
+ * Removes tags of XML file given a XPath. 
+ * @author mdecorde
+ *
+ */
+public class RemoveTag {
+	File outfile;
+	
+	/** The doc. */
+	Document doc;
+	
+	/**
+	 *
+	 * @param xmlfile the xmlfile
+	 * @param outfile the outfile
+	 * @param xpath the XPath
+	 */
+	public RemoveTag(File xmlfile, File outfile, String xpath)
+	{
+		this.outfile = outfile;
+		DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
+		domFactory.setNamespaceAware(true); // never forget this!
+		domFactory.setXIncludeAware(true);
+		DocumentBuilder builder = domFactory.newDocumentBuilder();
+		doc = builder.parse(xmlfile);
+		
+		def expr = XPathFactory.newInstance().newXPath().compile(xpath);
+		def nodes = expr.evaluate(doc, XPathConstants.NODESET);
+		
+		if (nodes != null)
+		for(def node : nodes)
+		{
+			//println "Remove node "+node
+			Element elem = (Element)node;
+			elem.getParentNode().removeChild(node);
+		}
+		save()
+		doc = null
+	}
+	
+	/**
+	 * Save.
+	 *
+	 * @return true, if successful
+	 */
+	private boolean save()
+	{
+		try {
+			// Création de la source DOM
+			Source source = new DOMSource(doc);
+			
+			// Création du fichier de sortie
+				Writer writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outfile), "UTF-8")); 
+			Result resultat = new StreamResult(writer);
+			
+			// Configuration du transformer
+			TransformerFactory fabrique = new net.sf.saxon.TransformerFactoryImpl();
+			Transformer transformer = fabrique.newTransformer();
+			transformer.setOutputProperty(OutputKeys.METHOD, "xml");
+			transformer.setOutputProperty(OutputKeys.INDENT, "yes"); 
+			transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); 
+			
+			// Transformation
+			transformer.transform(source, resultat);
+			writer.close();
+			return true;
+		} catch (Exception e) {
+			org.txm.utils.logger.Log.printStackTrace(e);
+			return false;
+		}
+	}
+	
+	public static void main(String[] args) {
+		RemoveTag rt = new RemoveTag(
+			new File("/home/mdecorde/TXM/corpora/graal/import.xml"),
+			new File("/home/mdecorde/TXM/corpora/graal/import-o.xml"),
+			"//edition[@name='courante']"
+			)
+	}
+}
Index: tmp/org.txm.core/src/java/org/txm/importer/INARecords.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/INARecords.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/INARecords.groovy	(revision 881)
@@ -0,0 +1,39 @@
+package org.txm.importer
+
+import org.txm.utils.CsvReader;
+import java.nio.charset.Charset;
+
+File csvFile = new File("/home/mdecorde/xml/notices/MARTICE_20130304_TF1_IMAGO_1994-12-31.csv")
+CsvReader reader = new CsvReader(csvFile.getAbsolutePath(), ";".charAt(0), Charset.forName("UTF-8"))
+
+reader.readHeaders()
+def headers = reader.getHeaders()
+int nheader = headers.size()
+int nlines = 0;
+def counts = new int[nheader]
+def values = [:]
+for (String key : headers) values[key] = new HashSet()
+
+while (reader.readRecord()) {
+	nlines++;
+	for (int i = 0 ; i < nheader ; i++) {
+		String key = headers[i]
+		String str = " "+reader.get(key);
+		//print str
+		if (str.trim().length() > 0) {
+			counts[i] = counts[i] + 1
+			values[key] << str.trim()
+		}
+	}
+	//println ""
+}
+
+println "N lines: "+nlines
+println "Empty cols: N <= 20"
+for (int i = 0 ; i < nheader ; i++) {
+	
+	if (counts[i] < 30) {
+		println ( headers[i]+ " : "+counts[i])
+		println values[headers[i]]
+	}
+}
\ No newline at end of file
Index: tmp/org.txm.core/src/java/org/txm/importer/MetadataGetter.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/MetadataGetter.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/MetadataGetter.groovy	(revision 881)
@@ -0,0 +1,35 @@
+package org.txm.importer
+
+import javax.xml.stream.*;
+
+class MetadataGetter {
+	public static String get(File xmlFile, String struct, String prop) {
+
+		def inputData = xmlFile.toURI().toURL().openStream();
+		def factory = XMLInputFactory.newInstance();
+		XMLStreamReader parser = factory.createXMLStreamReader(inputData);
+
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			if (event == XMLStreamConstants.START_ELEMENT) {
+				if ("text".equals(parser.getLocalName())) {
+					for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+						if(prop.equals(parser.getAttributeLocalName(i))) {
+							String tmp = parser.getAttributeValue(i)
+							parser.close()
+							return tmp
+						}
+					}
+				}
+			}
+		}
+		parser.close()
+		return null;
+	}
+
+	public static void main(String[] args) {
+		File xmlFile = new File("/home/mdecorde/TXM/corpora/superphenix/txm/SUPERPHENIX/CreysSuper_04_0175.xml")
+		String struct = "text"
+		String prop = "date"
+		println MetadataGetter.get(xmlFile, struct, prop)
+	}
+}
Index: tmp/org.txm.core/src/java/org/txm/importer/Pager.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/Pager.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/Pager.groovy	(revision 881)
@@ -0,0 +1,152 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 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: 2013-05-06 17:38:43 +0200 (lun. 06 mai 2013) $
+// $LastChangedRevision: 2386 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer
+import java.util.regex.Pattern
+// TODO: Auto-generated Javadoc
+
+/**
+ * The Class Pager.
+ */
+class Pager {
+	
+	//Prototype of generic pager
+	
+	//cut infos
+	
+	/** The cuttag. */
+	String cuttag = "w";// tag to cut, default <w>
+	
+	/** The cutattr. */
+	String cutattr;//attr of cuttag to test
+	
+	/** The cutvaluereg. */
+	Pattern cutvaluereg;// regex value
+	
+	/** The cutnumber. */
+	int cutnumber = 500;// number of cuttag before cutting, default 500 words
+	
+	//xpaths
+	
+	/** The xpaths. */
+	HashMap<String, String> xpaths = new HashMap<String, String>();
+	
+	//tag classes
+	
+	/** The ptags. */
+	public List<String> ptags = ["p", "lg", ];
+	
+	/** The linetags. */
+	public List<String> linetags = ["br", "lb", "l"];
+	
+	/** The dbllinetags. */
+	public List<String> dbllinetags = [];
+	
+	/** The commenttags. */
+	public List<String> commenttags = ["note"];
+	
+	/** The corrtags. */
+	public List<String> corrtags = ["corr"];
+	
+	/** The regtags. */
+	public List<String> regtags = ["reg"];
+	
+	/** The foreigntags. */
+	public List<String> foreigntags = ["foreign"];
+	
+	/**
+	 * Sets the cut infos.
+	 *
+	 * @param tag the tag
+	 * @param attr the attr
+	 * @param valuereg the valuereg
+	 * @param number the number
+	 */
+	public void setCutInfos(String tag, String attr, String valuereg, int number)
+	{
+		if(tag != null && tag.length() > 0)
+			cuttag = tag;
+		
+		try
+		{
+			Pattern p = Pattern.compile(valuereg);
+			cutvaluereg = p;
+		}
+		catch(Exception e){System.err.println("Pager: setCutInfos: Wrong regex syntax");}
+		
+		if(cutattr != null && cutattr.length() > 0)
+			cutattr = attr;
+		
+		if(cutnumber > 0)	
+			cutnumber = number;
+	}
+	
+	/**
+	 * Sets the x paths.
+	 *
+	 * @param xpaths the xpaths
+	 */
+	public void setXPaths(HashMap<String, String> xpaths)
+	{
+		if(xpaths != null)
+			this.xpaths = xpaths
+	}
+	
+	/**
+	 * Adds the x path.
+	 *
+	 * @param name the name
+	 * @param xpath the xpath
+	 */
+	public void addXPath(String name, String xpath)
+	{
+		if(xpath != null && name != null)
+			xpaths.put(name, xpath)
+	}
+	
+	/**
+	 * Run.
+	 *
+	 * @param infile the infile
+	 * @return true, if successful
+	 */
+	public boolean run(File infile)
+	{
+		
+	}
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		Pager p = new Pager()
+		p.setCutInfos("w","type", "{[|]@^[|`[{`]@^pon.*", 600);
+	}
+}
Index: tmp/org.txm.core/src/java/org/txm/importer/EncodeTEIQuotes.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/EncodeTEIQuotes.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/EncodeTEIQuotes.groovy	(revision 881)
@@ -0,0 +1,457 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 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: 2013-05-06 17:38:43 +0200 (lun. 06 mai 2013) $
+// $LastChangedRevision: 2386 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStreamReader;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class EncodeTEIQuotes.
+ */
+public class EncodeTEIQuotes
+{
+	
+	/** The name. */
+	def name;
+	
+	/** The initsize. */
+	def initsize;
+	
+	/** The quote. */
+	String quote ="\"";
+	
+	/** The quote_type. */
+	String quote_type= "pon"
+	
+		/**
+		 * Gets the name.
+		 *
+		 * @param node the xml node
+		 * @return the name of the node
+		 */
+	String getName(def node)
+	{
+		def name = node.name();
+		try{name = name.getLocalPart()}catch(Exception e){return name;} // might throw an exception depending on the node class
+		return name;
+	}
+	
+	/**
+	 * method to know if the Node is an element.
+	 *
+	 * @param n the n
+	 * @return true, if is elem
+	 */
+	boolean isElem(def n)
+	{
+		try{ n.name(); return true; }
+		catch(MissingMethodException e){ return false;}
+	}
+	
+	/**
+	 * Contains open quote.
+	 *
+	 * @param selem the node to process
+	 * @return true if the node contains a tag <q> at the beginning
+	 */
+	boolean containsOpenQuote(Node selem)
+	{
+		def children = selem.children()
+		//println "OTS: "+selem.attributes()
+		for(int i = 0 ; i < children.size()-1 ; i++)//on part de la fin jusqu'au 2e w
+		{
+			def child = children.get(i)
+			if(isElem(child))
+			{
+				name = getName(child)
+				if(name == "w" && child.@type != quote_type)
+				{
+					//println "not opening Q"
+					return false;
+				}
+				else if(name == "w" && child.@type == quote_type && child.text().equals(quote))
+				{
+					//println "opening Q"
+					return true;
+				}
+			}
+		}
+		//println "not opening Q"
+		return false;
+	}
+	
+	/**
+	 * Contains close quote.
+	 *
+	 * @param selem the node to process
+	 * @return true if the node contains a tag <q> at the end
+	 */
+	boolean containsCloseQuote(Node selem)
+	{
+		if(selem.w.size() == 0)
+			return false
+		//println "CTS: "+selem.attributes()
+		def children = selem.children()
+		for(int i = children.size()-1 ; i > 0 ; i--)//on part de la fin jusqu'au 2e w
+		{
+			def child = children.get(i)
+			if(isElem(child))
+			{
+				name = getName(child)
+				if(name == "w" && child.@type != quote_type)
+				{
+					//println "not closing Q"
+					return false;
+				}
+				else if(name == "w" && child.@type == quote_type && child.text().equals(quote))
+				{
+					//println "closing Q"
+					return true;
+				}
+			}
+		}
+		return false;
+	}
+	
+	/**
+	 * Next children are words.
+	 *
+	 * @param children the children
+	 * @param index the index
+	 * @return true, if successful
+	 */
+	def boolean nextChildrenAreWords(def children, def index)
+	{
+		//println "at "+children.get(index).attributes()+" test("+children.size()+") "+children
+		for(int i = index ; i < children.size() ; i++)
+		{
+			def nextC = children.get(i)
+			if(isElem(nextC) && getName(nextC) == "w" && nextC.@type != quote_type)
+				return true;
+		}
+		//println "no more words"
+		return false;
+	}
+	
+	/**
+	 * Process containers.
+	 *
+	 * @param root the root
+	 * @param containers the containers
+	 * @return the java.lang. object
+	 */
+	def processContainers(Node root, containers)
+	{
+		int countcontainer = 0;
+		int countinits = 0;
+		int countnews = 0;
+		int countinitquote = 0
+		int quotecount = 0;
+		boolean openq = false;
+		// cut sentences whit a wpon not first nor last
+		int initsizecontainer = root.children().size()
+		//println "process "+initsizecontainer+" elements"
+		for(int k = 0 ; k < initsizecontainer ; k++)
+		{
+			def node = root.children().get(0);
+			root.children().remove(0);
+			//println getName(node)
+			if(isElem(node) && containers.contains(getName(node)))
+			{
+				countcontainer++;
+				Node pelem = node;
+				openq = false;
+				//println "PAB================="
+				int initsize = pelem.children().size()
+				for(int j = 0 ; j < initsize ; j++) // pour chq fils de p
+				{
+					def subnode = pelem.children().get(0);
+					pelem.children().remove(0)
+					//println getName(subnode)
+					if(isElem(subnode) && getName(subnode) == "s") // si c un S
+					{
+						//println "\nS: "+subnode.attributes()
+						def selem = subnode;
+						def newS = pelem.appendNode(selem.name(), selem.attributes())
+						boolean isOpenningQuote = false;
+						if(containsOpenQuote(selem))
+						{
+							isOpenningQuote = true
+							if(openq)
+							{
+								//println "ERROR: unclosed quote before "+selem.@id
+							}
+							openq = false;
+							//println "force openq false"
+						}
+						int tempwponcount = 0
+						for(int i = 0 ; i < selem.children().size() ; i++) // append chacun de ses fils au S courant
+						{
+							def child = selem.children().get(i) // test si == wpon"
+							if(isElem(child) && getName(child) == "w" && child.@type == quote_type && child.text().equals(quote))
+							{
+								countinitquote++
+								//println "Q: "+child.attributes()
+								//println "openq "+openq
+								if(openq)
+								{
+									newS.children().add(child)
+									if(nextChildrenAreWords(selem.children(), i))
+									{                                                                             
+										//println "NEW S"
+										newS = pelem.appendNode(selem.name(), selem.attributes())
+									}
+									//println "set openq false"
+									openq = false;
+								}
+								else
+								{
+									if(tempwponcount != 0)// premier wpon"
+									{
+										//println "pas premier wpon''"
+										if(nextChildrenAreWords(selem.children(), i))// si y'a aut' chose deriere, new S
+										{
+											newS = pelem.appendNode(selem.name(), selem.attributes())
+											//println "NEW S"
+											//println "set openq true"
+											openq = true
+										}
+									}
+									else // tempwponcount == 0
+									{
+										if(!isOpenningQuote)
+										{
+											if(nextChildrenAreWords(selem.children(), i))// si y'a aut' chose deriere, new S
+											{
+												newS = pelem.appendNode(selem.name(), selem.attributes())
+											}
+										}
+										//println "set openq true"
+										openq = true
+									}
+									newS.children().add(child)
+								}
+								tempwponcount++;
+							}
+							else
+							{
+								newS.children().add(child)
+							}
+						}
+					}
+					else
+						pelem.children().add(subnode)
+				}
+			}
+			root.children().add(node)
+		}
+		// A partir d'ici on a que des phrases de la forme :
+		// s q wwww s
+		// s q wwww q s
+		// s wwww q s
+		//println "****"
+		//wrap sentences in q tags
+		initsize = root.children().size()
+		for(int j = 0 ; j < initsize ; j++)
+		{
+			def node = root.children().get(0);
+			root.children().remove(0)
+			if(isElem(node) && containers.contains(getName(node)))
+			{
+				Node pelem = node
+				//println "PPPPPPPP"
+				def newp = root.appendNode(getName(pelem), pelem.attributes());
+				//newp.attribute("test")
+				openq = false;
+				def children = pelem.children()
+				//println children
+				Node qelem;
+				for(Node subnode : children)
+				{
+					if(isElem(subnode) && (getName(subnode) == "s"))
+					{
+						countnews++;
+						//println "ELEM s"
+						Node selem = subnode;
+						if(containsOpenQuote(selem))
+						{
+							// println "openning wpon"
+							if(openq)
+							{
+								// println "ERROR: unclosed quote (found swpon)"
+								//on ferme, et ouvre un new
+								qelem.appendNode("note",[type:"auto"]).setValue("unclosed quote")
+								Map attrs = [:];
+								attrs.put("xml:id",""+(quotecount+1))
+								qelem = newp.appendNode("q", attrs)
+								quotecount++;
+								qelem.appendNode(getName(pelem), selem.attributes(), selem.value());
+								if(containsCloseQuote(selem)) // la phrase étaient bien balisée
+									openq = false;
+							}
+							else
+							{
+								// println "open q + append current s"
+								openq = true;
+								Map attrs = [:];
+								attrs.put("xml:id",""+(quotecount+1))
+								qelem = newp.appendNode("q", attrs)
+								quotecount++;
+								qelem.appendNode(getName(selem), selem.attributes(), selem.value());
+								if(containsCloseQuote(selem)) // la phrase étaient bien balisée
+									openq = false;
+							}
+						}
+						else if(containsCloseQuote(selem))
+						{
+							//println "closing wpon"
+							if(openq)
+							{
+								// println "close q + add dernier s du quote"
+								qelem.appendNode(getName(selem), selem.attributes(), selem.value());
+								openq = false;
+							}
+							else
+							{
+								//println "ERROR: unopened quote"
+								Map attrs = [:];
+								attrs.put("xml:id",""+(quotecount+1))
+								qelem = newp.appendNode("q", attrs)
+								qelem.appendNode(getName(selem), selem.attributes(), selem.value());
+								quotecount++;
+								qelem.appendNode("note",[type:"auto"]).setValue("unopened quote")
+							}
+						}
+						else // no wpon
+						{
+							// println "normal s"
+							if(openq)
+							{
+								// println "append to q"
+								qelem.appendNode(getName(selem), selem.attributes(), selem.value());
+							}
+							else
+							{
+								// println "append to p"
+								newp.appendNode(getName(selem), selem.attributes(), selem.value());
+							}
+						}
+					}
+					else
+					{
+						if(openq)
+						{
+							qelem.children().add(subnode)
+						}
+						else
+						{
+							newp.children().add(subnode)
+						}
+					}
+				}
+				if(openq)// un quote fermé a la fin du P !!
+				{
+					// println "ERROR: unmatched quote"
+					qelem.appendNode("note",[type:"auto"]).setValue("unmatched quote")
+				}
+				//root.children().add(newp)
+			}
+			else
+				root.children().add(node)
+		}
+		//count sentences
+		println "processed "+countcontainer+" "+containers
+		println "initial number of &quot; "+countinitquote;
+		println "created "+(countnews )+" init "+ countinits+" s"
+		println "create "+(quotecount)+" quotes elements"
+	}
+	
+	/**
+	 * Instantiates a new encode tei quotes.
+	 *
+	 * @param nodesToInspect the nodes to inspect
+	 * @param containers the containers
+	 * @param quote_value the quote_value
+	 * @param quote_type the quote_type
+	 */
+	public EncodeTEIQuotes(List<Node> nodesToInspect, containers, String quote_value, String quote_type)
+	{
+		this.quote= quote_value;
+		this.quote_type= quote_type;
+		println "process "+nodesToInspect.size()+" elements with containers "+containers
+		for(groovy.util.slurpersupport.Node root : nodesToInspect)//.body)
+		{
+			println(" root : "+root.children().size())
+			processContainers(root, containers)
+		}
+	}
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		List<String> containers = ["p","ab"]; // elements qui contiennent des <s>
+		
+		File infile = new File(System.getProperty("user.home"), "xml/quote/gormont.xml")
+		File outfile = new File(System.getProperty("user.home"), "xml/quote/gormont-q.xml")
+		
+		def doc = new XmlParser().parse (infile)
+		List<Node> nodesToInspect = doc.text.body
+		// nodesToInspect << doc.text.body.div // on en rajoute
+		
+		/*************************/
+		new org.txm.importer.EncodeTEIQuotes(nodesToInspect, containers, "\"", "pon");
+		
+		//copy the doc in "outfile" File  
+		String encoding = "UTF-8"
+		OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream(outfile) , encoding);
+		writer.write("<?xml version=\"1.0\" encoding=\""+encoding+"\"?>\n")
+		def pwriter = new PrintWriter(writer, true)
+		XmlNodePrinter xmlwriter = new XmlNodePrinter(pwriter)
+		xmlwriter.setPreserveWhitespace(false)
+		xmlwriter.print(doc)
+		pwriter.close()
+		writer.close()
+		xmlwriter = null
+		//println "write output file "+outfile
+		
+		//update counts
+		if(outfile.exists())
+		{
+			String txtid = org.txm.importer.WordCounter.findTextId(infile, "s"); // retrouve l'id du text qui a été concaténé aux id des S originels (ex : s19_12 >> 19)
+			new org.txm.importer.WordCounter(outfile, "s", txtid);
+			new org.txm.importer.WordCounter(outfile, "q", txtid);
+		}
+	}
+}
\ No newline at end of file
Index: tmp/org.txm.core/src/java/org/txm/importer/GetAttributeValue.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/GetAttributeValue.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/GetAttributeValue.groovy	(revision 881)
@@ -0,0 +1,47 @@
+package org.txm.importer
+
+import java.util.HashMap;
+import java.util.ArrayList;
+import java.io.File;
+import javax.xml.stream.*;
+import java.net.URL;
+
+class GetAttributeValue {
+	public static String process(File xmlFile, String path, String attribute) {
+		String value = "N/A";
+		String currentpath = "";
+		boolean done = false;
+		
+		try {
+			URL url = xmlFile.toURI().toURL();
+			def inputData = url.openStream();
+			def factory = XMLInputFactory.newInstance();
+			XMLStreamReader parser = factory.createXMLStreamReader(inputData);
+			for (int event = parser.next(); !done && event != XMLStreamConstants.END_DOCUMENT; event = parser.next())
+			{
+				switch (event) {
+					case XMLStreamConstants.START_ELEMENT:
+						currentpath += "/"+parser.getLocalName();// append the current tag to the current path
+						if (path == currentpath) {
+							for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+								if (parser.getAttributeName(i) == attribute) {
+									value = parser.getAttributeValue(i)
+									done = true;
+									break;
+								}
+							}
+						}
+						
+						break;
+					case XMLStreamConstants.END_ELEMENT:
+						currentpath = currentpath.substring(0,currentpath.length() -1 - parser.getLocalName().length()) // remove tag from the path
+						break;
+					
+				}
+			}
+			
+		}
+		catch(Exception e){println("File "+xmlFile+"\n"+e); return "N/A";}
+		return value;
+	}
+}
Index: tmp/org.txm.core/src/java/org/txm/importer/WExtract.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/WExtract.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/WExtract.groovy	(revision 881)
@@ -0,0 +1,334 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 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: 2015-12-17 12:11:39 +0100 (jeu. 17 déc. 2015) $
+// $LastChangedRevision: 3087 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+import javax.xml.stream.*;
+import java.io.File;
+import java.net.URL;
+
+// TODO: Auto-generated Javadoc
+/**
+ * Extract w tags from a tei file
+ * not finished.
+ *
+ * @author mdecorde
+ */
+class WExtract 
+{
+	
+	/**
+	 * Process.
+	 *
+	 * @param infile the infile
+	 * @param outfile the outfile
+	 * @param max the max
+	 * @return the java.lang. object
+	 */
+	public process(File infile, File outfile, int max)
+	{
+		println "Process "+infile.getName()+", keep $max words"
+		int count = this.countW(infile);
+		if(count < max)
+		{
+			println "can't extract $max words, the file "+infile.getName()+" contains only $count words"
+			return;
+		}
+		String ms = "#ms_K"
+		int tier = max/3;
+		int from1 = 0 
+		int to1 = tier;
+		int from2 = (count/2) - (tier/2);
+		int to2 =(count/2) + (tier/2);
+		int from3 = count -tier;
+		int to3= count-1;
+		boolean isSic = false;
+		boolean isW = false;
+		boolean isText = false;
+		boolean printW = true;
+		int wcount=0;
+		
+		println " count : "+count
+		println "  get from "+from1+" to "+to1
+		println "  get from "+from2+" to "+to2
+		println "  get from "+from3+" to "+to3
+		
+		
+		String localname;
+		String prefix;
+		InputStream inputData = infile.toURI().toURL().openStream();
+		XMLInputFactory inputfactory = XMLInputFactory.newInstance();
+		XMLStreamReader parser = inputfactory.createXMLStreamReader(inputData);
+		XMLOutputFactory factory = XMLOutputFactory.newInstance();
+		
+		FileOutputStream output = new FileOutputStream(outfile);
+		XMLStreamWriter writer = factory.createXMLStreamWriter(output, "UTF-8");
+		
+		writer.writeStartDocument("utf-8", "1.0");
+		
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) 
+		{
+			if(isText)
+			{
+				if((wcount >= from1 && wcount <= to1 )||
+				(wcount >= from2 && wcount <= to2) ||
+				(wcount >= from3 && wcount <= to3))
+					printW = true;
+				else
+					printW = false;
+			}
+			else
+				printW = true;
+			
+			switch (event) 
+			{
+				case XMLStreamConstants.START_ELEMENT:
+					localname = parser.getLocalName();
+					prefix = parser.getPrefix();
+				
+				/*
+				 if(localname == "supplied")
+				 if(parser.getAttributeValue(null,"source") != null)
+				 ms = parser.getAttributeValue(null,"source")
+				 if(localname == "sic")
+				 {
+				 isSic= true;
+				 }
+				 */
+					if(localname == "text")
+						isText = true;
+				
+					if(localname == "w")
+					{
+						isW= true;
+						wcount++;
+						
+						if(isText)
+						{
+							if((wcount >= from1 && wcount <= to1 )||
+							(wcount >= from2 && wcount <= to2) ||
+							(wcount >= from3 && wcount <= to3))
+								printW = true;
+							else
+								printW = false;
+						}
+						else
+							printW = true;
+					}
+				
+				/*if(!isSic)
+				 if(localname != "choice" && localname != "corr" && localname != "sic" && localname != "supplied" && localname != "seg")
+				 {*/
+					if(localname == "w")
+					{
+						if(printW)
+						{
+							if(prefix != null && prefix.length() > 0)
+								writer.writeStartElement(prefix+":"+localname);
+							else
+								writer.writeStartElement(localname);
+							
+							for(int i= 0 ; i < parser.getAttributeCount() ;i++ )
+							{
+								if(parser.getAttributePrefix(i)!= "")
+									writer.writeAttribute(parser.getAttributePrefix(i)+":"+parser.getAttributeLocalName(i), parser.getAttributeValue(i));
+								else
+									writer.writeAttribute(parser.getAttributeLocalName(i), parser.getAttributeValue(i));
+							}
+							//writer.writeAttribute("srcmf:src", ms);
+						}
+					}
+					else
+					{
+						if(prefix != null && prefix.length() > 0)
+							writer.writeStartElement(prefix+":"+localname);
+						else
+							writer.writeStartElement(localname);
+						
+						if(localname == "teiHeader")
+						{
+							writer.writeAttribute("xmlns:me", "http://www.menota.org/ns/1.0");
+							writer.writeAttribute("xmlns:bfm", "http://bfm.ens-lsh.fr/ns/1.0");
+							//writer.writeAttribute("xmlns:srcmf", "https://listes.cru.fr/wiki/srcmf/index");
+						}
+						
+						if(localname == "TEI")
+						{
+							writer.writeAttribute("xmlns","http://www.tei-c.org/ns/1.0");
+						}
+						
+						for(int i= 0 ; i < parser.getAttributeCount() ;i++ )
+						{
+							if(parser.getAttributePrefix(i)!= "")
+								writer.writeAttribute(parser.getAttributePrefix(i)+":"+parser.getAttributeLocalName(i), parser.getAttributeValue(i));
+							else
+								writer.writeAttribute(parser.getAttributeLocalName(i), parser.getAttributeValue(i));
+						}
+					}
+				//}
+					break;
+				
+				case XMLStreamConstants.END_ELEMENT:
+					localname =parser.getLocalName()
+				
+				/*if(localname == "sic")
+				 isSic= false;
+				 if(localname == "w")
+				 isW= false;
+				 if(localname == "supplied" && ms != "#ms_K")
+				 ms = "#ms_K";
+				 if(!isSic)
+				 if(localname != "choice" && localname != "corr" && localname != "sic" && localname != "supplied" && localname != "seg")
+				 {*/
+					if(localname == "w")
+					{
+						if(printW)
+						{
+							writer.writeEndElement();
+							writer.writeCharacters("\n");
+						}
+					}
+					else
+					{	
+						writer.writeEndElement();
+						writer.writeCharacters("\n");
+					}
+				//	}
+				
+					break;
+				
+				case XMLStreamConstants.CHARACTERS:
+				//if(!isSic)
+					if(isW)
+					{
+						if(printW)
+						{
+							writer.writeCharacters(parser.getText().trim());
+						}
+					}
+					else
+						writer.writeCharacters(parser.getText().trim());
+					break;
+			}
+		}
+		writer.flush();
+		writer.close();
+		output.close()
+		inputData.close();
+	}
+	
+	/**
+	 * Count w.
+	 *
+	 * @param infile the infile
+	 * @return the int
+	 */
+	public int countW(File infile)
+	{
+		InputStream inputData = infile.toURI().toURL().openStream();
+		XMLInputFactory inputfactory = XMLInputFactory.newInstance();
+		XMLStreamReader parser = inputfactory.createXMLStreamReader(inputData);
+		
+		int count = 0;
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) 
+		{
+			switch (event) 
+			{
+				case XMLStreamConstants.START_ELEMENT:
+					if(parser.getLocalName() == "w")
+						count++;
+			}
+		}
+		inputData.close()
+		return count;
+	}
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		String userDir = System.getProperty("user.home");
+		
+		File directory = new File(userDir+"/xml/extract/");
+		File outdir = new File(userDir+"/xml/extract/","results");
+		outdir.mkdir();
+		
+		File maxfile = new File(userDir+"/xml/extract/maxfile");
+		/*
+		 * maxfile format:
+		 * 
+		 * filename1.xml	45000
+		 * filename2.xml	22500
+		 * filename3.xml	45000
+		 */
+		HashMap<File, Integer> maxperfile = new HashMap<File, Integer>();
+		maxfile.eachLine{it->
+			String[] split = it.split("\t");
+			if(split.length == 2)
+			{
+				try
+				{
+				String filename = it.split("\t")[0];
+				int max = Integer.parseInt(it.split("\t")[1])
+				maxperfile.put(filename, max);
+				}catch(Exception e ){}
+			}
+		}
+		println maxperfile;
+		
+		def files = directory.listFiles();
+		for(File infile : files)
+		{
+			
+			if(maxperfile.containsKey(infile.getName()))
+			{
+				File outfile = new File(outdir, infile.getName());
+				int max= maxperfile.get(infile.getName());
+				new WExtract().process(infile, outfile, max)
+			}
+		}
+	}
+}
Index: tmp/org.txm.core/src/java/org/txm/importer/WExtractWithMode.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/WExtractWithMode.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/WExtractWithMode.groovy	(revision 881)
@@ -0,0 +1,376 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 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-10-19 17:50:26 +0200 (mer., 19 oct. 2011) $
+// $LastChangedRevision: 2038 $
+// $LastChangedBy: alavrentev $ 
+//
+package org.txm.importer
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+import javax.xml.stream.*;
+import java.io.File;
+import java.net.URL;
+
+// TODO: Auto-generated Javadoc
+/**
+ * Extract w tags from a tei file
+ * not finished.
+ *
+ * @author mdecorde
+ */
+class WExtractWithMode 
+{
+	
+	/**
+	 * Process.
+	 *
+	 * @param infile the infile
+	 * @param outfile the outfile
+	 * @param max the max
+	 * @return the java.lang. object
+	 */
+	public process(File infile, File outfile, String modemax)
+	{
+		println "Process "+infile.getName()+", keep $modemax words"
+		int count = this.countW(infile);
+		
+		int max = 0
+		String mode = ""
+		
+		try {
+		mode = modemax.split("/")[0]
+		max = Integer.parseInt(modemax.split("/")[1])		
+		}catch(Exception e ){}
+		
+		if(count < max)
+		{
+			println "can't extract $max words, the file "+infile.getName()+" contains only $count words"
+			return;
+		}
+		//String ms = "#ms_K"
+		int part = 0; 
+		if (mode == "3")
+		{
+			part = max/3		
+		}
+		else if (mode == "2")
+		{
+			part = max/2
+		}
+		else if (mode == "1a" || mode == "1m" || mode == "1z")
+		{
+			part = max
+		}
+		else
+		{
+			println "mode must be 1a, 1m, 1z, 2 or 3"
+			return
+		}
+		int from1 = 0 
+		int to1 = 0
+		if (mode != "1m" && mode != "1z")
+		{
+			to1 = part
+		}
+		int from2 = 0
+		int to2 = 0
+		if (mode == "3" || mode == "1m")
+		{
+			from2 = (count/2) - (part/2);
+			to2 =(count/2) + (part/2);			
+		}
+		int from3 = 0
+		int to3 = 0
+		if (mode != "1a" && mode != "1m")
+		{
+			from3 = count -part;
+			to3= count-1;			
+		}
+		boolean isSic = false;
+		boolean isW = false;
+		boolean isText = false;
+		boolean printW = true;
+		int wcount=0;
+		
+		println " count : "+count
+		println "  get from "+from1+" to "+to1
+		println "  get from "+from2+" to "+to2
+		println "  get from "+from3+" to "+to3
+		
+		
+		String localname;
+		String prefix;
+		InputStream inputData = infile.toURI().toURL().openStream();
+		XMLInputFactory inputfactory = XMLInputFactory.newInstance();
+		XMLStreamReader parser = inputfactory.createXMLStreamReader(inputData);
+		XMLOutputFactory factory = XMLOutputFactory.newInstance();
+		
+		FileOutputStream output = new FileOutputStream(outfile)
+		XMLStreamWriter writer = factory.createXMLStreamWriter(output, "UTF-8");
+		
+		writer.writeStartDocument("utf-8", "1.0");
+		
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) 
+		{
+			if(isText)
+			{
+				if((wcount >= from1 && wcount <= to1 )||
+				(wcount >= from2 && wcount <= to2) ||
+				(wcount >= from3 && wcount <= to3))
+					printW = true;
+				else
+					printW = false;
+			}
+			else
+				printW = true;
+			
+			switch (event) 
+			{
+				case XMLStreamConstants.START_ELEMENT:
+					localname = parser.getLocalName();
+					prefix = parser.getPrefix();
+				
+				/*
+				 if(localname == "supplied")
+				 if(parser.getAttributeValue(null,"source") != null)
+				 ms = parser.getAttributeValue(null,"source")
+				 if(localname == "sic")
+				 {
+				 isSic= true;
+				 }
+				 */
+					if(localname == "text")
+						isText = true;
+				
+					if(localname == "w")
+					{
+						isW= true;
+						wcount++;
+						
+						if(isText)
+						{
+							if((wcount >= from1 && wcount <= to1 )||
+							(wcount >= from2 && wcount <= to2) ||
+							(wcount >= from3 && wcount <= to3))
+								printW = true;
+							else
+								printW = false;
+						}
+						else
+							printW = true;
+					}
+				
+				/*if(!isSic)
+				 if(localname != "choice" && localname != "corr" && localname != "sic" && localname != "supplied" && localname != "seg")
+				 {*/
+					if(localname == "w")
+					{
+						if(printW)
+						{
+							if(prefix != null && prefix.length() > 0)
+								writer.writeStartElement(prefix+":"+localname);
+							else
+								writer.writeStartElement(localname);
+							
+							for(int i= 0 ; i < parser.getAttributeCount() ;i++ )
+							{
+								if(parser.getAttributePrefix(i)!= "")
+									writer.writeAttribute(parser.getAttributePrefix(i)+":"+parser.getAttributeLocalName(i), parser.getAttributeValue(i));
+								else
+									writer.writeAttribute(parser.getAttributeLocalName(i), parser.getAttributeValue(i));
+							}
+							//writer.writeAttribute("srcmf:src", ms);
+						}
+					}
+					else
+					{
+						if(prefix != null && prefix.length() > 0)
+							writer.writeStartElement(prefix+":"+localname);
+						else
+							writer.writeStartElement(localname);
+						
+						if(localname == "teiHeader")
+						{
+							writer.writeAttribute("xmlns:me", "http://www.menota.org/ns/1.0");
+							writer.writeAttribute("xmlns:bfm", "http://bfm.ens-lsh.fr/ns/1.0");
+							//writer.writeAttribute("xmlns:srcmf", "https://listes.cru.fr/wiki/srcmf/index");
+						}
+						
+						if(localname == "TEI")
+						{
+							writer.writeAttribute("xmlns","http://www.tei-c.org/ns/1.0");
+						}
+						
+						for(int i= 0 ; i < parser.getAttributeCount() ;i++ )
+						{
+							if(parser.getAttributePrefix(i)!= "")
+								writer.writeAttribute(parser.getAttributePrefix(i)+":"+parser.getAttributeLocalName(i), parser.getAttributeValue(i));
+							else
+								writer.writeAttribute(parser.getAttributeLocalName(i), parser.getAttributeValue(i));
+						}
+					}
+				//}
+					break;
+				
+				case XMLStreamConstants.END_ELEMENT:
+					localname =parser.getLocalName()
+				
+				/*if(localname == "sic")
+				 isSic= false;
+				 if(localname == "w")
+				 isW= false;
+				 if(localname == "supplied" && ms != "#ms_K")
+				 ms = "#ms_K";
+				 if(!isSic)
+				 if(localname != "choice" && localname != "corr" && localname != "sic" && localname != "supplied" && localname != "seg")
+				 {*/
+					if(localname == "w")
+					{
+						if(printW)
+						{
+							writer.writeEndElement();
+							writer.writeCharacters("\n");
+						}
+					}
+					else
+					{	
+						writer.writeEndElement();
+						writer.writeCharacters("\n");
+					}
+				//	}
+				
+					break;
+				
+				case XMLStreamConstants.CHARACTERS:
+				//if(!isSic)
+					if(isW)
+					{
+						if(printW)
+						{
+							writer.writeCharacters(parser.getText().trim());
+						}
+					}
+					else
+						writer.writeCharacters(parser.getText().trim());
+					break;
+			}
+		}
+		writer.flush();
+		writer.close();
+		output.close()
+		inputData.close();
+	}
+	
+	/**
+	 * Count w.
+	 *
+	 * @param infile the infile
+	 * @return the int
+	 */
+	public int countW(File infile)
+	{
+		InputStream inputData = infile.toURI().toURL().openStream();
+		XMLInputFactory inputfactory = XMLInputFactory.newInstance();
+		XMLStreamReader parser = inputfactory.createXMLStreamReader(inputData);
+		
+		int count = 0;
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) 
+		{
+			switch (event) 
+			{
+				case XMLStreamConstants.START_ELEMENT:
+					if(parser.getLocalName() == "w")
+						count++;
+			}
+		}
+		inputData.close()
+		return count;
+	}
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		String userDir = System.getProperty("user.home");
+		
+		File directory = new File(userDir+"/xml/extract/");
+		File outdir = new File(userDir+"/xml/extract/","results");
+		outdir.mkdir();
+		
+		File maxfilemode = new File(userDir+"/xml/extract/maxfilemode");
+		/*
+		 * maxfilemode format:
+		 * 
+		 * filename1.xml	3	45000
+		 * filename2.xml	1a	15000
+		 * filename3.xml	1m	15000
+		 * filename4.xml	1z	15000
+		 * filename5.xml	2	22500
+		 */
+		HashMap<File, String> maxperfile = new HashMap<File, String>();
+		maxfilemode.eachLine{it->
+			String[] split = it.split("\t");
+			if(split.length == 3)
+			{
+				try
+				{
+				String filename = it.split("\t")[0];
+				String modemax = it.split("\t")[1]+"/"+it.split("\t")[2]
+				maxperfile.put(filename, modemax);
+				}catch(Exception e ){}
+			}
+		}
+		println maxperfile;
+		
+		def files = directory.listFiles();
+		for(File infile : files)
+		{
+			
+			if(maxperfile.containsKey(infile.getName()))
+			{
+				File outfile = new File(outdir, infile.getName());
+				String modemax = maxperfile.get(infile.getName());
+				new WExtractWithMode().process(infile, outfile, modemax)
+			}
+		}
+	}
+}
Index: tmp/org.txm.core/src/java/org/txm/importer/NiceToXML.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/NiceToXML.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/NiceToXML.groovy	(revision 881)
@@ -0,0 +1,202 @@
+package org.txm.importer
+
+import javax.xml.stream.XMLStreamException
+import org.apache.tools.ant.types.resources.selectors.InstanceOf;
+import groovy.xml.*
+
+def root = new File("/home/mdecorde/xml/temoignagesnice/corpus Matrice - fichiers xmlisés/")
+File srcdir = new File(root, "orig");
+File outdir = new File(root, "tmp");
+File okdir = new File(root, "ok");
+File ok2dir = new File(root, "ok2");
+File temoignagedir = new File(root, "temoignages");
+ok2dir.deleteDir()
+ok2dir.mkdir()
+
+//rename title -> head
+for (def file : outdir.listFiles()) {
+	if (!file.getName().endsWith(".xml")) continue;
+	def doc = new XmlParser().parse(file);
+	
+	for (def note : doc.body.chapter.title) {
+		println note
+		note.name = "head"
+	}
+	
+	new File(ok2dir, file.getName()).withWriter("UTF-8") { writer ->
+		new XmlNodePrinter(new PrintWriter(writer)).print(doc)
+	}
+}
+
+/*
+// ADD chapter@title
+for (def file : outdir.listFiles()) {
+	if (!file.getName().endsWith(".xml")) continue;
+	def doc = new XmlParser().parse(file);
+	
+	for (def chapter : doc.body.chapter) {
+		for (def title : chapter.title) {
+			chapter.@title = title.text()
+			break;
+		}
+	}
+	
+	new File(ok2dir, file.getName()).withWriter("UTF-8") { writer ->
+		new XmlNodePrinter(new PrintWriter(writer)).print(doc)
+	}
+}
+*/
+//FIX figure and caption inclusions
+/*
+for (def file : outdir.listFiles()) {
+	if (!file.getName().endsWith(".xml")) continue;
+	def doc = new XmlParser().parse(file);
+	for (def note : doc.body."**".figure) {
+		note.name = "note"
+		//println "fig : $note"
+		//if ("Image :" == note.text()) {
+			def children = note.parent().children()
+			int i = children.indexOf(note)
+			//println i + " < "+children.size()
+			def nextChild = children[i+1]
+			if (nextChild != null && nextChild.name().toString() == "caption") {
+				println nextChild
+
+				note.value = "Images : "+note.text()// + " "+nextChild.text()
+				//println note
+
+				children.remove(i+1)
+				note.append(nextChild)
+			}
+		//}
+	}
+
+	new File(ok2dir, file.getName()).withWriter("UTF-8") { writer ->
+		new XmlNodePrinter(new PrintWriter(writer)).print(doc)
+	}
+}
+*/
+/*
+// DOCBOOK -> DOCBOOK TEXT ONLY
+for (def file : outdir.listFiles()) {
+	def doc = new XmlParser().parse(file);
+
+	def body = null
+	def bookinfo = null
+	def preface = null
+	for (def e : doc.body) body = e
+
+	for (def e : doc.bookinfo) {
+		doc.remove(e)
+	}
+	for (def e : doc.preface) {
+		doc.remove(e)
+	}
+	for (def e : doc.appendix) {
+		doc.remove(e)
+	}
+	for (def e : doc.chapter) {
+		doc.remove(e)
+	}
+
+	if (body == null) {
+		println "error text: "+file
+		continue
+	}
+
+	new File(ok2dir, file.getName()).withWriter("UTF-8") { writer ->
+		new XmlNodePrinter(new PrintWriter(writer)).print(doc)
+	}
+	//		writer.print XmlUtil.serialize(new StreamingMarkupBuilder().bind {
+	//			mkp.yield body
+	//		  })
+}
+*/
+//DOCBOOK to TEI
+/*
+ for (def file : outdir.listFiles()) {
+ def doc = new XmlParser().parse(file);
+ def body = null
+ //def bookinfo = null
+ for (def e : doc.body) body = e
+ //for (def e : doc.bookinfo) bookinfo = e
+ //println body.getClass()
+ if (body == null) {
+ println "error text: "+file
+ continue
+ }
+ //	bookinfo.name = "teiHeader"
+ body.name = "text"
+ def teins = new groovy.xml.Namespace("http://www.tei-c.org/ns/1.0",'tei')
+ //	for (def node : body."**") {
+ //		if (node instanceof String) continue
+ //		def name = node.name()
+ //		if (name instanceof String)
+ //			node.name = teins.get(name)
+ //		else 
+ //			node.name = teins.get(name.getLocalPart())
+ //	}
+ for (def figure : body."**".figure) {
+ figure.name = "note"
+ figure.value = "Image : " + figure.caption.text()
+ }
+ for (def chapter : body."**".chapter) {
+ chapter.name = "div"
+ chapter.@type = "chapter"
+ }
+ for (def caption : body."**".title) {
+ caption.name = "head"
+ }
+ for (def para : body."**".para) {
+ para.name = "p"
+ }
+ def newdoc = new Node(null, "TEI");
+ newdoc.@xmlns="http://www.tei-c.org/ns/1.0";
+ newdoc.append(new Node(null, "teiHeader"))
+ newdoc.append(body)
+ new File(okdir, file.getName()).withWriter("UTF-8") { writer ->
+ new XmlNodePrinter(new PrintWriter(writer)).print(newdoc)
+ }
+ //		writer.print XmlUtil.serialize(new StreamingMarkupBuilder().bind {
+ //			mkp.yield body
+ //		  })
+ }
+ */
+
+// remove TEI
+/*outdir.deleteDir()
+ outdir.mkdir()
+ def errors = []
+ for (def file : srcdir.listFiles()) {
+ if (file.isDirectory()) continue;
+ //new EncodingConverter(file, "Windows-1252", "UTF-8")
+ File outfile = new File(outdir, file.getName());
+ outfile.withWriter("UTF-8") { writer ->
+ file.eachLine("UTF-8") { line ->
+ if (line.trim() == "<TEI>") {
+ } else if (line.trim() == "</TEI>") {
+ writer.println("</book>")
+ } else if (line.trim() == "<book lang=\"fr\"/>") {
+ writer.println("<book lang=\"fr\">")
+ } else {
+ writer.println(line)
+ }
+ }		
+ }
+ try {
+ ValidateXml.testAndThrow(outfile);
+ } catch (XMLStreamException e) {
+ println file.getName() + " : "+ e.getMessage()
+ errors << file
+ if (e.getMessage().contains('Message: The element type "TEI" must be terminated by the matching end-tag "</TEI>"')) {
+ println "Delete line : "+e.location.lineNumber
+ }
+ println ""
+ }
+ }
+ */
+println "done"
+//if (errors.size() > 0)
+//	println ""+errors.size()+" errors : $errors"
+//String content = file.getText("Windows-1252")
+//println content
\ No newline at end of file
Index: tmp/org.txm.core/src/java/org/txm/importer/HTML2XHTML.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/HTML2XHTML.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/HTML2XHTML.groovy	(revision 881)
@@ -0,0 +1,42 @@
+package org.txm.importer
+
+import org.txm.utils.CharsetDetector;
+import org.txm.importer.ValidateXml;
+
+File infile = new File("/home/mdecorde/Bureau/matrice/témoignages/CONVERSIONS/jod/odt.html")
+File outfile = new File("/home/mdecorde/Bureau/matrice/témoignages/CONVERSIONS/jod/odt.xml")
+
+String encoding = new CharsetDetector(infile).getEncoding();
+println "Encoding: $encoding"
+String text = infile.getText(encoding);
+
+//lower case tags
+text = text.replaceAll(/(<[^!][^>]*>)/, 
+	{ full, word -> 
+		//fix attributes TRUC=sdf234
+		word = word.replaceAll("([A-Z]+=)([^\" >]+)([ >])",'$1"$2"$3' )
+		word.toLowerCase() // bourrin
+	} )
+
+//lower case <.> tags
+text = text.replaceAll(/(<.>)/,
+	{ full, word ->
+		word.toLowerCase()
+	} )
+
+//resolve entities
+text = text.replaceAll(/&nbsp;/," ")
+
+//close tags
+text = text.replaceAll(/<br>/,"<br/>")
+text = text.replaceAll(/<meta([^>]*)>/,'<meta$1/>')
+text = text.replaceAll(/<img([^>]*)>/,'<img$1/>')
+
+//remove doctype declaration
+text = text.replace('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">', '')
+
+//write&Validate
+outfile.withWriter(encoding) { writer -> writer.write(text) }
+if (!ValidateXml.test(outfile)) {
+	println "FILE: $outfile"
+}
\ No newline at end of file
Index: tmp/org.txm.core/src/java/org/txm/importer/XMLText2TXTCSV.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/XMLText2TXTCSV.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/XMLText2TXTCSV.groovy	(revision 881)
@@ -0,0 +1,32 @@
+package org.txm.importer
+
+File dir = new File("/home/mdecorde/xml/voeux/split_xml")
+File outdir = new File("/home/mdecorde/xml/voeux/split_txtcsv")
+println "1) xml -> txt + write metadata.csv"
+outdir.deleteDir()
+outdir.mkdir()
+File metadatafile = new File(outdir, "metadata.csv")
+String csvString = ""
+
+def files = dir.listFiles()
+files.sort()
+for(File f : files)
+{
+	File outfile = new File(outdir, f.getName()+".txt");
+	String text = f.getText("UTF-8");
+	String texttag = text.find("<text id.*>")
+//	println texttag
+//	texttag = texttag.replaceAll('<text id="([^"]+)"', '<text id="$1.txt"')
+//	println "> "+texttag
+	text = text.replaceAll("<text.*>", "").replace("</text>", "");
+	outfile.withWriter("UTF-8"){writer -> writer.write(text) }
+	csvString += texttag.replace("<text id=","").replace(" loc=", ",").replace(" annee=", ",").replace("\">", "\"")+"\n"
+}
+
+println "2) write metadata.csv"
+metadatafile.withWriter("UTF-8"){csvwriter -> 
+	csvwriter.write("\"id\",\"loc\",\"annee\"\n");
+	csvwriter.write(csvString)}
+
+println "3) rename Voeux_*"
+outdir.eachFileMatch(~/Voeux_.*/) {file-> file.renameTo(new File(outdir, file.getName().substring(6, 10)+".txt")) }
Index: tmp/org.txm.core/src/java/org/txm/importer/xmltxm/PersonalNamespaceContext.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/xmltxm/PersonalNamespaceContext.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/xmltxm/PersonalNamespaceContext.groovy	(revision 881)
@@ -0,0 +1,118 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 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: 2016-02-01 09:53:38 +0100 (lun. 01 févr. 2016) $
+// $LastChangedRevision: 3101 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.xmltxm
+
+import java.util.Iterator;
+
+import javax.xml.*;
+import javax.xml.namespace.NamespaceContext;
+
+import org.xml.sax.helpers.NamespaceSupport;
+
+/**
+ * Instantiates a new personal namespace context.
+ *
+ * @author ayepdieu, mdecorde
+ * 
+ * do correpondances between namespace and uri
+ */
+public class PersonalNamespaceContext implements NamespaceContext {
+	
+	public static HashMap<String, String> adress2name = new HashMap<String, String>();
+	public static HashMap<String, String> name2adress = new HashMap<String, String>();
+	static {
+		addNamespace("tei", "http://www.tei-c.org/ns/1.0")
+		addNamespace("me", "http://www.menota.org/ns/1.0")
+		addNamespace("bfm", "http://bfm.ens-lsh.fr/ns/1.0")
+		addNamespace("txm", "http://textometrie.org/1.0")
+		addNamespace("xi", "http://www.w3.org/2001/XInclude")
+		addNamespace("fn", "http://www.w3.org/2005/xpath-functions")
+		addNamespace("xhtml", "http://www.w3.org/1999/xhtml")
+		addNamespace("svg", "http://www.w3.org/2000/svg")
+		addNamespace(XMLConstants.XML_NS_PREFIX, XMLConstants.XML_NS_URI)
+	}
+	/*
+	String TEINS = "http://www.tei-c.org/ns/1.0"
+	String MENS = "http://www.menota.org/ns/1.0";
+	String BFMNS = "http://bfm.ens-lsh.fr/ns/1.0";
+	String TXMNS = "http://textometrie.org/1.0";
+	String XINS = "http://www.w3.org/2001/XInclude";
+	String FNNS = "http://www.w3.org/2005/xpath-functions";
+	String XHTMLNS = "http://www.w3.org/1999/xhtml";
+	String SVGNS = "http://www.w3.org/2000/svg"
+	String XMLNS = "http://www.w3.org/XML/1998/namespace"
+
+	String TEINSNAME = "tei"
+	String MENSNAME = "me";
+	String BFMNSNAME = "bfm";
+	String TXMNSNAME = "txm";
+	String XINSNAME = "xi";
+	String FNNSNAME = "fn";
+	String XHTMLNSNAME = "xhtml";
+	String SVGNSNAME = "svg"
+*/
+	public PersonalNamespaceContext() {
+		super();
+	}
+
+	public static void addNamespace(String name, String address) {
+		adress2name.put(address, name);
+		name2adress.put(name, address);
+	}
+	
+	/* (non-Javadoc)
+	 * @see javax.xml.namespace.NamespaceContext#getNamespaceURI(java.lang.String)
+	 */
+	public String getNamespaceURI(String prefix) {
+		if (!name2adress.containsKey(prefix)) return XMLConstants.NULL_NS_URI;
+		return name2adress.get(prefix)
+	}
+
+	private static String NONE = "";
+	/**
+	 * 
+	 * @param uri the uri
+	 * @return the prefix
+	 */
+	public String getPrefix(String uri) {
+		
+		if (uri == null) return NONE;
+		if (!adress2name.containsKey(uri)) return NONE;
+		return adress2name.get(uri)
+	}
+
+	/**
+	 * This method isn't necessary for XPath processing either.
+	 *
+	 * @param uri the uri
+	 * @return the prefixes
+	 */
+	public Iterator getPrefixes(String uri) {
+		throw new UnsupportedOperationException();
+	}
+}
\ No newline at end of file
Index: tmp/org.txm.core/src/java/org/txm/importer/xmltxm/AnnotateWTC.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/xmltxm/AnnotateWTC.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/xmltxm/AnnotateWTC.groovy	(revision 881)
@@ -0,0 +1,178 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 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: 2013-12-06 16:57:35 +0100 (Fri, 06 Dec 2013) $
+// $LastChangedRevision: 2583 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.xmltxm
+
+import java.io.File
+import java.text.DateFormat
+import java.util.Date
+
+import org.txm.Toolbox
+import org.txm.importer.*
+import org.txm.importer.cwb.*
+import org.txm.objects.*
+import org.txm.stat.utils.ConsoleProgressBar
+import org.txm.utils.DeleteDir;
+import org.txm.utils.LangDetector;
+import org.txm.utils.treetagger.TreeTagger
+
+// TODO: Auto-generated Javadoc
+/**
+ * Annotate and replace the TEI-TXM files of the folder $rootDirFile/txm with TreeTagger.
+ * creates $rootDirFile/interp and $rootDirFile/treetagger
+ *
+ */
+class AnnotateCQP {
+
+	/** The debug. */
+	boolean debug = true;
+
+	/**
+	 * Sets the debug.
+	 */
+	public void setDebug() { debug=true; }
+
+	String id;
+
+	/**
+	 * Apply tt.
+	 *
+	 * @param ttsrcfile the ttsrcfile
+	 * @param ttoutfile the ttoutfile
+	 * @param modelfile the modelfile
+	 * @return true, if successful
+	 */
+	public boolean applyTT(File ttsrcfile, File ttoutfile, File modelfile)
+	{
+		try {
+			File infile = ttsrcfile;
+			File outfile = ttoutfile;
+
+			// TODO: why org.txm.utils.treetagger.TreeTagger tt = ..., throw IllegalAccessError ???
+			String opt = Toolbox.getPreference(Toolbox.TREETAGGER_OPTIONS);
+			if (opt == null) opt = "";
+			String[] options = opt.split("  ");
+			def tt = new TreeTagger(Toolbox.getPreference(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/", options);
+			tt.settoken();
+			tt.setlemma();
+			tt.setquiet();
+			tt.setsgml();
+			tt.setnounknown();
+			tt.seteostag("<s>");
+			tt.treetagger(modelfile.getAbsolutePath(), infile.getAbsolutePath(), outfile.getAbsolutePath())
+			//infile.delete();
+		}
+		catch(Exception e)
+		{
+			e.printStackTrace();
+			return false;
+		}
+		return true;
+	}
+
+	/**
+	 * Run.
+	 *
+	 * @param rootDirFile the root dir file
+	 * @param modelfilename the modelfilename
+	 * @return true, if successful
+	 */
+	public boolean run(File binDir, File txmDir,  String modelfilename)
+	{
+		//test if modelfile exists
+		if(debug) {
+			println "rootDirFile "+binDir
+			println "txmDir "+txmDir
+			println "TREETAGGER INSTALL PATH : "+Toolbox.getPreference(Toolbox.TREETAGGER_INSTALL_PATH)
+			println "TREETAGGER MODELS PATH : "+Toolbox.getPreference(Toolbox.TREETAGGER_MODELS_PATH)
+		}
+
+		//test if the Toolbox know TreeTagger
+		if (!new File(Toolbox.getPreference(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/").exists())
+		{
+			println("Could not find TreeTagger binaries in "+Toolbox.getPreference(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/")
+			return false;
+		}
+
+		//cleaning
+		File annotDir = new File(binDir, "annotations")
+		annotDir.mkdir();
+
+		//BUILD TT FILE READY TO BE TAGGED
+		//println "Re "+Toolbox.getParam(Toolbox.TREETAGGER_APOSTROPHE)
+		List<File> files = txmDir.listFiles()
+
+		// get model file and check it
+		File modelfile = new File(Toolbox.getPreference(Toolbox.TREETAGGER_MODELS_PATH), modelfilename);
+		if (debug)
+			println "model file : "+modelfile;
+
+		if (!modelfile.exists()) {
+			println "Skipping ANNOTATE: Incorrect modelfile path: "+modelfile;
+			if(System.getProperty("os.name").startsWith("Windows"))
+				println "Windows users: Windows might be hiding files extension. To see them, in the explorer parameters."
+			return false;
+		}
+
+		//APPLY TREETAGGER
+		println("Applying $modelfilename TreeTagger model on dir: "+txmDir+ " ("+files.size()+" files)")
+		if (files == null || files.size() == 0)
+			return false;
+
+		ConsoleProgressBar cpb = new ConsoleProgressBar(files.size());
+		for (File f : files) {
+			cpb.tick();
+			
+			File infile = f;
+			File outfile = new File(new File(binDir, "annotations"), f.getName());
+			if (outfile.exists() && // outfile exists
+				outfile.lastModified() >= infile.lastModified() && // outfile is more recent 
+				outfile.length() > infile.length()) { // outfile is bigger
+				// skip
+			} else {
+				if (!applyTT(infile, outfile, modelfile)) {
+					System.out.println("Failed to apply treetagger on file "+f);
+					return false;
+				}
+			}
+		}
+		println("")
+
+//		if (DeleteDir.deleteDirectory(txmDir)) {
+//			if (annotDir.renameTo(txmDir)) {
+//
+//			} else {
+//				println "Could not rename  'annotations' directory to 'txm' directory"
+//				return false
+//			}
+//		} else {
+//			println "Could not delete txmDir: $txmDir (and could not copy 'annotations' directory"
+//		}
+
+		return true;
+	}
+}
\ No newline at end of file
Index: tmp/org.txm.core/src/java/org/txm/importer/xmltxm/WLX2TXMTEI.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/xmltxm/WLX2TXMTEI.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/xmltxm/WLX2TXMTEI.groovy	(revision 881)
@@ -0,0 +1,286 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 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: 2013-05-06 17:38:43 +0200 (lun. 06 mai 2013) $
+// $LastChangedRevision: 2386 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.xmltxm
+
+import java.util.ArrayList;
+import javax.xml.stream.*;
+import java.net.URL;
+import org.txm.importer.filters.*;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class AnnotationInliner.
+ *
+ * @author mdecorde build a xml-tei-txm from a weblex xml file
+ * @deprecated
+ */
+
+public class WLX2TXMTEI {
+
+	/** The input data. */
+	private def inputData;
+
+	/** The factory. */
+	private def factory;
+
+	/** The parser. */
+	private def parser;
+
+	/** The dir. */
+	private def dir;
+
+	/** The output. */
+	private def output;
+
+	/** The url. */
+	private def url;
+
+	/** The solotags. */
+	ArrayList<String> solotags;
+
+	/**
+	 * initialize.
+	 *
+	 * @param url the url to the file to transform
+	 * @param solotags temporary list of milestones tags
+	 */
+	public WLX2TXMTEI(URL url, ArrayList<String> solotags) {
+		try {
+			this.url = url;
+			this.solotags = solotags;
+			inputData = url.openStream();
+			factory = XMLInputFactory.newInstance();
+			parser = factory.createXMLStreamReader(inputData);
+		} catch (XMLStreamException ex) {
+			System.out.println(ex);
+		} catch (IOException ex) {
+			System.out.println("IOException while parsing ");
+		}
+	}
+
+	/**
+	 * create output FileWriter.
+	 *
+	 * @param dirPathName the dir path name
+	 * @param fileName the file name
+	 * @return true, if successful
+	 */
+	private boolean createOutput(String dirPathName, String fileName){
+		try {
+			dir = new File(dirPathName)
+			File f = new File(dir, fileName);
+			output = new java.io.FileWriter(f)
+
+			return true;
+		} catch (Exception e) {
+			System.out.println("la?"+e);
+			return false;
+		}
+	}
+
+	/**
+	 * process !!!.
+	 *
+	 * @param dirPathName the dir path name
+	 * @param fileName the file name
+	 * @return true, if successful
+	 */
+	public boolean transfomFile(String dirPathName, String fileName){
+		if(createOutput(dirPathName, fileName)){
+
+			int idPb = 0;
+			def idLb = "";
+			String idLinesuiv;
+			int charcount=0;
+			String lastopenlocalname= "";
+
+			boolean flagWord = false;
+			boolean flagNorm = false;
+			String vWordNorm = "";
+			String anabalises = "";
+			String vP2 = "";
+			int idcount=1;
+			String targets= "w_fro_"
+
+			try {
+				File inputfile = new File(this.url.getFile());
+				for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+					switch (event) {
+						case XMLStreamConstants.START_ELEMENT:
+							switch (parser.getLocalName()) {
+								case "w":
+								output.write("\n<w xml:id=\""+targets+idcount+"\"");
+								idcount++;
+								anabalises = "";
+								for(int i= 0 ; i < parser.getAttributeCount() ;i++ )
+								{
+									switch(parser.getAttributeLocalName(i))
+									{
+										case "p2":
+											anabalises += "<txm:ana ref=\"#TT1\" type=\"#t1\">" + parser.getAttributeValue(i)+"</txm:ana>\n"
+											break
+										case "p3":
+											anabalises += "<txm:ana ref=\"#TT1\" type=\"#lemma\">" + parser.getAttributeValue(i)+"</txm:ana>\n"
+											break
+										case "p4":
+											anabalises += "<txm:ana ref=\"#TT1\" type=\"#lasla\">" + parser.getAttributeValue(i)+"</txm:ana>\n"
+											break
+										case "p5":
+											anabalises += "<txm:ana ref=\"#TT1\" type=\"#grace\">" + parser.getAttributeValue(i)+"</txm:ana>\n"
+											break
+										case "p6":
+											anabalises += "<txm:ana ref=\"#TT1\" type=\"#t5\">" + parser.getAttributeValue(i)+"</txm:ana>\n"
+											break
+										case "p7":
+											anabalises += "<txm:ana ref=\"#TT1\" type=\"#tt\">" + parser.getAttributeValue(i)+"</txm:ana>\n"
+											break
+										case "p8":
+											anabalises += "<txm:ana ref=\"#TT1\" type=\"#tt\">" + parser.getAttributeValue(i)+"</txm:ana>\n"
+											break
+										case "p9":
+											anabalises += "<txm:ana ref=\"#TT1\" type=\"#tt\">" + parser.getAttributeValue(i)+"</txm:ana>\n"
+											break
+										case "p10":
+											anabalises += "<txm:ana ref=\"#TT1\" type=\"#tt\">" + parser.getAttributeValue(i)+"</txm:ana>\n"
+											break
+										case "p11":
+											anabalises += "<txm:ana ref=\"#TT1\" type=\"#tt\">" + parser.getAttributeValue(i)+"</txm:ana>\n"
+											break
+										case "p12":
+											anabalises += "<txm:ana ref=\"#TT1\" type=\"#tt\">" + parser.getAttributeValue(i)+"</txm:ana>\n"
+											break
+										case "p13":
+											anabalises += "<txm:ana ref=\"#TT1\" type=\"#tt\">" + parser.getAttributeValue(i)+"</txm:ana>\n"
+											break
+										default:
+											output.write(" "+parser.getAttributeLocalName(i)+"=\""+parser.getAttributeValue(i)+"\"" );
+									}
+								}
+
+								output.write(">\n");
+								flagWord = true;
+								break;
+
+								case "TEI":
+								output.write("\n<TEI");
+								for(int i= 0 ; i < parser.getAttributeCount() ;i++ )
+									output.write(" "+parser.getAttributeLocalName(i)+"=\""+parser.getAttributeValue(i)+"\"" );
+								output.write(" xmlns:txm=\"http://textometrie.ens-lyon.fr/1.0\"" );
+								output.write(">\n");
+								break;
+								default:
+								lastopenlocalname = parser.getLocalName();
+								output.write("\n<"+parser.getLocalName());
+								for(int i= 0 ; i < parser.getAttributeCount() ;i++ )
+									output.write(" "+parser.getAttributeLocalName(i)+"=\""+parser.getAttributeValue(i)+"\"" );
+								if(solotags.contains(lastopenlocalname))
+									output.write("/>");
+								else
+									output.write(">");
+								charcount=0;
+							}
+							break;
+
+						case XMLStreamConstants.END_ELEMENT:
+							switch (parser.getLocalName()) {
+								case "w":
+								output.write("<txm:form>"+vWordNorm+"</txm:form>")
+								output.write("\n"+anabalises);
+								output.write("</w>");
+								vWordNorm = "";
+								anabalises ="";
+								flagWord = false;
+								break;
+								default:
+								//if(charcount > 0)
+								//output.write("\n");
+								if(!solotags.contains(parser.getLocalName()))
+									if(lastopenlocalname.equals(parser.getLocalName()))
+										output.write("</"+parser.getLocalName()+">");
+									else
+										output.write("\n</"+parser.getLocalName()+">");
+							}
+							break;
+
+						case XMLStreamConstants.CHARACTERS:
+							if (flagWord) {
+
+								vWordNorm += parser.getText().trim();
+
+							} else
+							{
+								String txt = parser.getText().trim();
+								output.write(txt);
+								charcount += txt.length();
+							}
+							break;
+					}
+				}
+
+				output.close();
+				parser.close();
+			}
+			catch (XMLStreamException ex) {
+				System.out.println(ex);
+			}
+			catch (IOException ex) {
+				System.out.println("IOException while parsing " + inputData);
+			}
+		}
+	}
+
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args) {
+
+		String rootDir = "~/xml/rgaqcj/";
+		new File(rootDir+"/anainline/").mkdir();
+
+		def files = ["roland.xml","qgraal_cm.xml","artu.xml","qjm.xml","commyn1.xml","jehpar.xml"];
+		def anafiles = ["roland-ana.xml","qgraal_cm-ana.xml","artu-ana.xml","qjm-ana.xml","commyn1-ana.xml","jehpar-ana.xml"];
+		ArrayList<String> solotags = new ArrayList<String>();
+		solotags.add("tagUsage");
+		solotags.add("pb");
+		solotags.add("lb");
+		solotags.add("catRef");
+
+		for(int i=0; i < files.size();i++)
+		{
+			String file = files[i];
+			String anafile = anafiles[i];
+			def builder = new WLX2TXMTEI(new File(rootDir+"/src/",file).toURL(),solotags);
+			builder.transfomFile(rootDir+"/anainline/",anafile);
+		}
+
+
+		return
+	}
+}
Index: tmp/org.txm.core/src/java/org/txm/importer/xmltxm/InlineCleaner.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/xmltxm/InlineCleaner.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/xmltxm/InlineCleaner.groovy	(revision 881)
@@ -0,0 +1,205 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 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: 2016-03-29 09:51:35 +0200 (mar. 29 mars 2016) $
+// $LastChangedRevision: 3185 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.xmltxm
+
+import java.text.DateFormat;
+import java.util.Date;
+import java.util.ArrayList;
+import javax.xml.stream.*;
+import java.net.URL;
+import org.txm.importer.filters.*;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class InlineCleaner.
+ *
+ * @author mdecorde
+ * remove all ana tags of a xml-tei-txm file it supose you have
+ * the stand-off version
+ */
+
+public class InlineCleaner {
+	
+	/** The url. */
+	private def url;
+	
+	/** The input data. */
+	private def inputData;
+	
+	/** The factory. */
+	private def factory;
+	
+	/** The parser. */
+	private XMLStreamReader parser;
+
+	/** The output. */
+	private def output;
+	
+	/** The solotags. */
+	ArrayList<String> solotags;
+
+	/**
+	 * Instantiates a new inline cleaner.
+	 *
+	 * @param url the url
+	 * @param outfile the outfile
+	 * @param solotags the solotags
+	 */
+	public InlineCleaner(URL url, File outfile, ArrayList<String> solotags) {
+		try {
+			this.url = url;
+			this.solotags = solotags;
+			inputData = url.openStream();
+			factory = XMLInputFactory.newInstance();
+
+			parser = factory.createXMLStreamReader(inputData);
+
+			this.transformFile(outfile);
+
+		} catch (XMLStreamException ex) {
+			System.out.println(ex);
+		} catch (IOException ex) {
+			System.out.println("IOException while parsing ");
+		}
+	}
+
+	/**
+	 * Creates the output.
+	 *
+	 * @param outfile the outfile
+	 * @return true, if successful
+	 */
+	private boolean createOutput(File outfile) {
+		output = new OutputStreamWriter(new FileOutputStream(outfile), "UTF-8");
+		return true;
+	}
+
+	/**
+	 * Transform file.
+	 *
+	 * @param outfile the outfile
+	 * @return true, if successful
+	 */
+	public boolean transformFile(File outfile) {
+		boolean shouldwrite = true;
+		boolean isW = false;
+		String lastopenlocalname = "";
+
+		if (!createOutput(outfile))
+			return false;
+
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser
+				.next()) {
+			String prefix = parser.getPrefix();
+			if (prefix == null)
+				prefix = "";
+			else
+				prefix += ":";
+
+			switch (event) {
+			case XMLStreamConstants.START_ELEMENT:
+				
+				if (parser.getLocalName().equals("w")) {
+					isW = true;
+				} 
+				
+				if (parser.getLocalName().equals("ana") && isW) {
+					shouldwrite = false;
+				} else {
+					lastopenlocalname = parser.getLocalName();
+					output.write("\n<" + prefix + parser.getLocalName());
+					if (parser.getLocalName().equals("TEI"))
+						output
+								.write(" xmlns:txm=\"http://textometrie.ens-lyon.fr/1.0\"");
+					for (int i = 0; i < parser.getAttributeCount(); i++) {
+						String attname = parser.getAttributeLocalName(i);
+						output.write(" " + attname + "=\""
+								+ parser.getAttributeValue(i) + "\"");
+					}
+					if (solotags.contains(lastopenlocalname))
+						output.write("/>");
+					else
+						output.write(">");
+				}
+				break;
+			case XMLStreamConstants.END_ELEMENT:
+				switch (parser.getLocalName()) {
+				case "ana":
+					if(isW)
+						shouldwrite = true;
+					break;
+				case "w":
+					isW = false;
+					//do default
+				default:
+					if (!solotags.contains(parser.getLocalName()))
+						if (lastopenlocalname.equals(parser.getLocalName()))
+							output.write("</" + prefix + parser.getLocalName()+ ">");
+						else
+							output.write("\n</" + prefix
+									+ parser.getLocalName() + ">");
+				}
+				break;
+
+			case XMLStreamConstants.CHARACTERS:
+				if (shouldwrite) {
+					String txt = parser.getText().trim();
+					output.write(txt);
+				}
+				break;
+			}
+		}
+		output.close();
+		parser.close();
+	}
+
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args) {
+
+		String rootDir = "~/xml/rgaqcj/";
+		new File(rootDir + "/cleaner/").mkdir();
+
+		ArrayList<String> milestones = new ArrayList<String>();// the tags who stay milestones
+		milestones.add("tagUsage");
+		milestones.add("pb");
+		milestones.add("lb");
+		milestones.add("catRef");
+
+		File srcfile = new File(rootDir + "/anainline/", "roland-ana.xml");
+		File cleanfile = new File(rootDir + "/cleaner/", "roland-off.xml");
+
+		System.out.println("clean file " + srcfile);
+		def builder = new InlineCleaner(srcfile.toURL(), cleanfile, milestones);
+		return;
+	}
+
+}
Index: tmp/org.txm.core/src/java/org/txm/importer/xmltxm/Annotate.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/xmltxm/Annotate.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/xmltxm/Annotate.groovy	(revision 881)
@@ -0,0 +1,552 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 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: 2016-10-03 15:30:36 +0200 (lun. 03 oct. 2016) $
+// $LastChangedRevision: 3313 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.xmltxm
+
+import java.io.File
+import java.text.DateFormat
+import java.util.Date
+import java.util.concurrent.*
+
+import org.txm.Toolbox
+import org.txm.importer.*
+import org.txm.importer.cwb.*
+import org.txm.objects.*
+import org.txm.stat.utils.ConsoleProgressBar;
+import org.txm.utils.LangDetector;
+import org.txm.utils.logger.Log;
+import org.txm.utils.treetagger.TreeTagger
+
+// TODO: Auto-generated Javadoc
+/**
+ * Annotate and replace the TEI-TXM files of the folder $rootDirFile/txm with TreeTagger.
+ * creates $rootDirFile/interp and $rootDirFile/treetagger
+ *
+ */
+class Annotate
+{
+	boolean cancelNow = false;
+
+	/** The report file. */
+	File reportFile;//contains the txm:application tag content
+
+	/** The resp person. */
+	String respPerson;
+
+	/** The resp id. */
+	String respId;
+
+	/** The resp desc. */
+	String respDesc;
+
+	/** The resp date. */
+	String respDate;
+
+	/** The resp when. */
+	String respWhen;
+
+	/** The app ident. */
+	String appIdent;
+
+	/** The app version. */
+	String appVersion;
+
+	/** The distributor. */
+	String distributor;
+
+	/** The publi stmt. */
+	String publiStmt;
+
+	/** The source stmt. */
+	String sourceStmt;
+
+	/** The types. */
+	def types;
+
+	/** The types title. */
+	def typesTITLE;
+
+	/** The types desc. */
+	def typesDesc;
+
+	/** The types tagset. */
+	def typesTAGSET;
+
+	/** The types web. */
+	def typesWEB;
+
+	/** The idform. */
+	String idform;
+
+	/** The debug. */
+	boolean debug = false;
+
+	File modelsDirectory;
+	
+	public Annotate() {
+		modelsDirectory = new File(Toolbox.getPreference(Toolbox.TREETAGGER_MODELS_PATH)); // default models directory is set in the Toolbox
+	}
+		
+	/**
+	 * Sets the debug.
+	 */
+	public void setDebug() {
+		debug = true;
+	}
+
+	String id;
+	/**
+	 * Inits the tt outfile infos.
+	 *
+	 * @param rootDirFile the root dir file
+	 * @param modelfile the modelfile
+	 */
+	public void initTTOutfileInfos(File rootDirFile, File modelfile, String modelfilename)
+	{
+		initTTOutfileInfos(rootDirFile, modelfile, modelfilename, null);
+	}
+	
+	/**
+	 * Inits the tt outfile infos.
+	 *
+	 * @param rootDirFile the root dir file
+	 * @param modelfile the modelfile
+	 * @param properties : 2 element array that contains the word properties to create. It can be null (the modelfilename will be used)
+	 */
+	public void initTTOutfileInfos(File rootDirFile, File modelfile, String modelfilename, String[] properties)
+	{
+		id = modelfilename;
+		String[] split = id.split("\\.");
+		if (split.length > 0) id = split[0];
+		if (id.equals("??")) id = "xx"
+
+		reportFile = new File(rootDirFile,"NLPToolsParameters.xml");
+
+		respPerson = System.getProperty("user.name");
+		respId = "txm";
+		respDesc = "NLP annotation tool";
+		respDate = DateFormat.getDateInstance(DateFormat.SHORT, Locale.UK).format(new Date());
+		respWhen = DateFormat.getDateInstance(DateFormat.FULL, Locale.UK).format(new Date());
+
+		appIdent = "TreeTagger";
+		appVersion = "3.2";
+
+		distributor = "";
+		publiStmt = """""";
+		sourceStmt = """""";
+
+		if (properties != null && properties.length == 2) {
+			types = [properties[0],properties[1]];
+			typesTITLE = [properties[0],properties[1]];
+		} else {
+			types = [id+"pos",id+"lemma"];
+			typesTITLE = [id+"pos",id+"lemma"];
+		}
+		
+		//TODO: the tagset, website and description should be referenced in the model catalog
+		if(modelfile.getName() == "rgaqcj.par") {
+			typesDesc = ["CATTEX pos tagset built with BFM texts","fr lemma of the model "+modelfile+" - "]
+			typesTAGSET = ["http://bfm.ens-lyon.fr/IMG/pdf/Cattex2009_Manuel.pdf",""]
+			typesWEB = ["http://bfm.ens-lyon.fr/",""]
+		} else {
+			typesDesc = ["pos tagset built from model "+modelfile,id+" lemma of the model "+modelfile+" - "]
+			typesTAGSET = ["",""]
+			typesWEB = ["",""]
+		}
+		
+		idform ="w";
+	}
+
+	/**
+	 * Apply tt.
+	 *
+	 * @param ttsrcfile the ttsrcfile
+	 * @param ttoutfile the ttoutfile
+	 * @param modelfile the modelfile
+	 * @return true, if successful
+	 */
+	public boolean applyTT(File ttsrcfile, File ttoutfile, File modelfile)
+	{
+		applyTT(ttsrcfile, ttoutfile, modelfile, null)
+	}
+	
+	/**
+	 * Apply tt.
+	 *
+	 * @param ttsrcfile the ttsrcfile
+	 * @param ttoutfile the ttoutfile
+	 * @param modelfile the modelfile
+	 * @param options, if null use value set in Toolbox preferences
+	 * @return true, if successful
+	 */
+	public boolean applyTT(File ttsrcfile, File ttoutfile, File modelfile, String[] options)
+	{
+		try {
+			File infile = ttsrcfile;
+			File outfile = ttoutfile;
+
+			// TODO: why org.txm.utils.treetagger.TreeTagger tt = ..., throw IllegalAccessError ???
+			String opt = Toolbox.getParam(Toolbox.TREETAGGER_OPTIONS);
+			if (options == null) {
+				if (opt == null) opt = "";
+				options = opt.split("  ");
+			}
+			
+			def tt = new TreeTagger(Toolbox.getParam(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/", options);
+			tt.settoken();
+			tt.setlemma();
+			tt.setquiet();
+			tt.setsgml();
+			tt.setnounknown();
+			tt.seteostag("<s>");
+			tt.debug(debug);
+			tt.treetagger(modelfile.getAbsolutePath(), infile.getAbsolutePath(), outfile.getAbsolutePath())
+			infile.delete();
+		} catch(Exception e) {
+			Log.printStackTrace(e);
+			System.out.println("Failed to apply TreeTagger on $f input file with the $modelfile model file.");
+			return false;
+		}
+		return true;
+	}
+
+	/**
+	 * Write standoff file.
+	 *
+	 * @param ttoutfile the ttoutfile
+	 * @param posfile the posfile
+	 * @return true, if successful
+	 */
+	public boolean writeStandoffFile(File ttoutfile, File posfile)
+	{
+		def encoding ="UTF-8";
+		def transfo = new CSV2W_ANA();
+		//println("build w-interp "+ttfile.getName()+ ">>"+posfile.getName())
+		transfo.setAnnotationTypes( types, typesDesc, typesTAGSET, typesWEB, idform);
+		transfo.setResp(respId, respDesc, respDate, respPerson, respWhen);
+		transfo.setApp(appIdent, appVersion);
+		transfo.setTarget(ttoutfile.getAbsolutePath(), reportFile);
+		transfo.setInfos(distributor,  publiStmt, sourceStmt);
+		return transfo.process( ttoutfile, posfile, encoding );
+	}
+
+	/**
+	 * Run step by step : build TT src files, run TT, build xml-standoff files, inject standoff annotations
+	 *
+	 * @param rootDirFile the root dir file
+	 * @param modelfilename the modelfilename
+	 * @return true, if successful
+	 */
+	public boolean run(File binDir, File txmDir,  String modelfilename)
+	{
+		//test if modelfile exists
+		if (debug) {
+			println "rootDirFile "+binDir
+			println "txmDir "+txmDir
+			println "TREETAGGER INSTALL PATH : "+Toolbox.getPreference(Toolbox.TREETAGGER_INSTALL_PATH)
+			println "TREETAGGER MODELS PATH : "+Toolbox.getPreference(Toolbox.TREETAGGER_MODELS_PATH)
+		}
+
+		//test if the Toolbox know TreeTagger
+		if (!new File(Toolbox.getPreference(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/").exists()) {
+			println("Could not find TreeTagger binaries in "+Toolbox.getPreference(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/")
+			return false;
+		}
+		String langAll = null
+		String lang;
+		if (modelfilename.startsWith("??")) {
+			langAll = new LangDetector(binDir).getLang();
+			println "General lang $langAll"
+		}
+
+		//cleaning
+		new File(binDir, "annotations").deleteDir();
+		new File(binDir, "annotations").mkdir();
+		new File(binDir, "treetagger").deleteDir();
+		new File(binDir, "treetagger").mkdir();
+
+		ArrayList<String> milestones = [];
+
+		//BUILD TT FILE READY TO BE TAGGED
+		//println "Re "+Toolbox.getParam(Toolbox.TREETAGGER_APOSTROPHE)
+		List<File> files = txmDir.listFiles()
+
+		println("Building TT source files ("+files.size()+") from directory "+txmDir)
+		ConsoleProgressBar cpb = new ConsoleProgressBar(files.size())
+		for (File f : files) {
+			cpb.tick()
+			File srcfile = f;
+			File resultfile = new File(binDir, "treetagger/"+f.getName()+".tt");
+			if(debug)
+				println "build tt src : "+srcfile+" >> "+resultfile
+			def ttsrcbuilder = new BuildTTSrc(srcfile.toURI().toURL())
+			if (!ttsrcbuilder.process(resultfile, null))
+				System.out.println("Failed to build tt src file of "+srcfile);
+		}
+
+		if (cancelNow) return;
+
+		File modelDirectory = new File(Toolbox.getPreference(Toolbox.TREETAGGER_MODELS_PATH));
+		if (!modelDirectory.exists()) {
+			println "Skipping ANNOTATE: TreeTagger language model file directory not found: "+modelDirectory.getAbsolutePath();
+			return false;
+		} else 	if (!modelDirectory.canRead()) {
+			println "Skipping ANNOTATE: impossible to access the TreeTagger language model file directory: "+modelDirectory.getAbsolutePath();
+			return false;
+		}
+		println("")
+		//Convert encoding if needed
+
+		//APPLY TREETAGGER
+		files = new File(binDir, "treetagger").listFiles()
+		println("Applying $modelfilename TreeTagger model on dir: "+new File(binDir, "treetagger")+ " ("+files.size()+" files)")
+		if (files == null || files.size() == 0)
+			return false;
+		File modelfile;
+		cpb = new ConsoleProgressBar(files.size())
+		for (File f : files) {
+			String tmpModelFileName = modelfilename
+			if (modelfilename.startsWith("??")) {
+				lang = langAll;
+				if (f.length() > LangDetector.MINIMALSIZE) {
+					lang = new LangDetector(f).getLang();
+					//println "guessing lang $f : $lang"
+				}
+				tmpModelFileName = lang+".par"
+			}
+			modelfile = new File(modelsDirectory, tmpModelFileName);
+			if (debug)
+				println "model file : "+modelfile;
+
+			File
+
+			if (!modelfile.exists()) {
+				println "Skipping ANNOTATE: '$modelfile' TreeTagger language model file not found."
+				if(System.getProperty("os.name").startsWith("Windows") || System.getProperty("os.name").startsWith("Mac"))
+					println "Windows&Mac users: the operating system might be hiding file extensions. Use your file explorer to check the file name."
+				return false;
+			} else if (!modelfile.canRead()) {
+				println "Skipping ANNOTATE: impossible to access the '$modelfile' TreeTagger language model file."
+				return false;
+			}
+
+			//			if (modelfile.getName().equals("sp.par")) {//UTF >> Latin1
+			//				if(debug)
+			//					println "fix encoding for model "+modelfile
+			//				new EncodingConverter(f, "UTF-8", "ISO-8859-1")
+			//			}
+
+			cpb.tick()
+			File infile = f;
+			File outfile = new File(f.getParent(),f.getName()+"-out.tt");
+			if (!applyTT(infile, outfile, modelfile)) {
+				return false;
+			}
+
+			//			//Reconvert encoding if needed
+			//			if (modelfile.getName().equals("sp.par")) {
+			//				if(debug)
+			//					println "convert "+f+" latin1 >> UTF-8"
+			//				new EncodingConverter(f, "ISO-8859-1", "UTF-8")
+			//			}
+		}
+		println("")
+
+		if (cancelNow) return;
+
+		//BUILD STAND-OFF FILES
+		if (modelfile == null) {
+			println "no model applied"
+			return false;
+		}
+
+		initTTOutfileInfos(binDir, modelfile, modelfilename);
+		files = new File(binDir, "treetagger").listFiles()// now contains the result files of TT
+		println "Building stdoff files ("+files.size()+") from dir:"+new File(binDir, "treetagger")+" to "+new File(binDir, "annotations");
+		if (files == null || files.size() == 0)
+			return false;
+		cpb = new ConsoleProgressBar(files.size())
+		for (File ttrezfile : files) {
+			cpb.tick()
+			File annotfile = new File(binDir, "annotations/"+ttrezfile.getName()+"-STOFF.xml");
+			if (!writeStandoffFile(ttrezfile, annotfile))
+				println("Failed to build standoff file of "+ttrezfile);
+		}
+		println("")
+
+		if (cancelNow) return;
+
+		//INJECT ANNOTATIONS
+		List<File> interpfiles = new File(binDir, "annotations").listFiles();
+		List<File> txmfiles = txmDir.listFiles();
+		if (txmfiles == null) {
+			println "No file to annotate in "+txmDir.getAbsolutePath()
+			return false;
+		}
+		interpfiles.sort(); // same order
+		txmfiles.sort(); //same order
+		println "Injecting stdoff files ("+interpfiles.size()+") data from "+new File(binDir, "annotations")+ " to xml-txm files of "+txmDir;
+		if (interpfiles == null || interpfiles.size() == 0)
+			return false;
+		cpb = new ConsoleProgressBar(interpfiles.size())
+		for (int i = 0 ; i < interpfiles.size() ; i++) {
+			cpb.tick()
+			File srcfile = txmfiles.get(i);
+			File pos1file = interpfiles.get(i);
+			File temp = File.createTempFile("Annotate", "temp", srcfile.getParentFile());
+			def builder = new AnnotationInjection(srcfile.toURI().toURL(), pos1file.toURI().toURL());
+			if (!builder.process(temp)) {
+				return false;
+			}
+			builder = null;
+
+			//println "renaming files..."
+			if (!(srcfile.delete() && temp.renameTo(srcfile)))
+				println "Warning can't rename file "+temp+" to "+srcfile
+		}
+		println("")
+		return true;
+	}
+	
+	public void setModelsDirectory(File modelsDirectory) {
+		this.modelsDirectory = modelsDirectory;
+	}
+
+	/**
+	 * Run file by file. Allow to have one different lang per file. Default behavior add new word properties
+	 *
+	 * @param binDir
+	 * @param txmDir
+	 * @param lang associate a file name with a model filename
+	 * @return true, if successful
+	 */
+	public boolean run(File binDir, File txmDir, HashMap<String, String> langs)
+	{
+		return run(binDir, txmDir, langs, false, new String[0], new String[0]);
+	}
+	
+	/**
+	 * Run file by file. Allow to have one different lang per file
+	 *
+	 * @param binDir 
+	 * @param txmDir
+	 * @param lang associate a file name with a model filename
+	 * @param replace, replace or create a word property
+	 * @return true, if successful
+	 */
+	public boolean run(File binDir, File txmDir, HashMap<String, String> langs, boolean replace, String[] properties, String[] options)
+	{
+		if (!new File(Toolbox.getParam(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/").exists()) {
+			println("Path to TreeTagger is wrong "+Toolbox.getParam(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/")
+			return true;
+		}
+
+		List<File> listfiles = txmDir.listFiles();
+
+		//cleaning
+		File annotDir = new File(binDir,"annotations");
+		annotDir.deleteDir();
+		annotDir.mkdir();
+		File ptreetaggerDir = new File(binDir,"ptreetagger");
+		ptreetaggerDir.deleteDir();
+		ptreetaggerDir.mkdir();
+		File treetaggerDir = new File(binDir,"treetagger");
+		treetaggerDir.deleteDir();
+		treetaggerDir.mkdir();
+
+		int cores = Runtime.getRuntime().availableProcessors()
+		int coresToUse = Math.max(1.0, cores * 0.7)
+		ExecutorService pool = Executors.newFixedThreadPool(coresToUse)
+
+		def files = txmDir.listFiles()
+		ConsoleProgressBar cpb = new ConsoleProgressBar(files.size())
+		for (File teiFile : files) {
+			int counter = 1;
+			ThreadFile t = new ThreadFile("TT_"+counter++, teiFile) {
+
+						public void run() {
+
+							if (cancelNow) return;
+
+							if (langs.get(f.getName()) == null) {
+								println "Error: no lang defined for file $f"
+								return;
+							}
+
+							String model = langs.get(f.getName());
+							File modelfile = new File(modelsDirectory, model+".par");
+							if (!modelfile.exists()) {
+								println "Error: No Modelfile available for lang "+modelfile+". Continue import process ";
+								return;
+							}
+							File annotfile = new File(annotDir, f.getName()+"-STDOFF.xml");
+							File ttsrcfile = new File(ptreetaggerDir, f.getName()+"-src.tt");
+							File ttrezfile = new File(treetaggerDir, f.getName()+"-out.tt");
+							//println ("TT with $model "+f+"+"+annotfile+" > "+ttsrcfile+" > "+ttrezfile);
+
+							//BUILD TT FILE READY TO BE TAGGED
+							def builder = new BuildTTSrc(f.toURL());
+							builder.process(ttsrcfile, null);
+
+							//Apply TT
+							applyTT(ttsrcfile, ttrezfile, modelfile, options);
+
+							//CREATE STANDOFF FILES
+							initTTOutfileInfos(binDir, modelfile, model, properties);
+							writeStandoffFile(ttrezfile, annotfile)
+
+							//INJECT ANNOTATIONS
+							File tmpFile = new File(txmDir, "temp_"+f.getName())
+							builder = new AnnotationInjection(f.toURL(), annotfile.toURL(), replace);
+							builder.process(tmpFile);
+							if (!(f.delete() && tmpFile.renameTo(f))) println "Warning can't rename file "+tmpFile+" to "+f
+
+							cpb.tick();
+						}
+					};
+
+			pool.execute(t)
+		}
+
+		pool.shutdown()
+		pool.awaitTermination(10, TimeUnit.HOURS)
+		println ""
+		return true;
+	}
+
+	public void setCancelNow() {
+		cancelNow = true;
+	}
+
+	public class ThreadFile extends Thread {
+		File f;
+		public ThreadFile(String name, File f) {
+			this.setName(name)
+			this.f = f;
+		}
+	}
+}
\ No newline at end of file
Index: tmp/org.txm.core/src/java/org/txm/importer/xmltxm/AnnotationInjectionFromTTOutput.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/xmltxm/AnnotationInjectionFromTTOutput.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/xmltxm/AnnotationInjectionFromTTOutput.groovy	(revision 881)
@@ -0,0 +1,360 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 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: 2016-03-02 14:17:06 +0100 (mer., 02 mars 2016) $
+// $LastChangedRevision: 3134 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.xmltxm
+import javax.xml.stream.*
+
+import org.txm.importer.StaxIdentityParser
+import org.txm.importer.filters.*
+import org.txm.importer.PersonalNamespaceContext
+
+/**
+ * The Class AnnotationInjection.
+ *
+ * @author mdecorde
+ * 
+ * inject annotation from a stand-off file into a xml-tei-txm file
+ */
+
+public class AnnotationInjectionFromTTOutput extends StaxIdentityParser {
+
+	public static String TXMNS = "http://textometrie.org/1.0"
+
+	/** The xml reader factory. */
+	private def factory;
+
+	/** The links. */
+	private List<String> links;
+
+	/** The linkparsers. key=type*/
+	private HashMap<String, XMLStreamReader> linkparsers;
+
+	/** The anaurl. */
+	private def anaurl;
+
+	/** The anainput data. */
+	private def anainputData;
+
+	/** The anafactory. */
+	private XMLInputFactory anafactory = XMLInputFactory.newInstance();
+
+	/** The anaparser. */
+	private XMLStreamReader anaparser;
+	private XMLStreamReader headerparser;
+
+	/** The resp stmt id. */
+	String respStmtID = "";
+
+	/** The present taxonomies. */
+	ArrayList<String> presentTaxonomies = new ArrayList();
+
+	/**
+	 * Instantiates a new annotation injection.
+	 *
+	 * @param url the xml-tei-txm file
+	 * @param anaurl the stand-off file
+	 */
+	public AnnotationInjectionFromTTOutput(URL url, URL anaurl) {
+		super(url); // init reader and writer
+		try {
+			this.anaurl = anaurl;
+			factory = XMLInputFactory.newInstance();
+			this.buildLinkParsers();// build a parser per linkgroup
+		} catch (XMLStreamException ex) {
+			System.out.println(ex);
+		} catch (IOException ex) {
+			System.out.println("IOException while parsing ");
+		}
+	}
+
+	private void getHeaderInfos(String containertag, boolean captureTheTag)
+	{
+		anainputData = new BufferedInputStream(anaurl.openStream());
+		headerparser = anafactory.createXMLStreamReader(anainputData);
+		boolean start = false;
+		String localname;
+		for (int event = headerparser.next(); event != XMLStreamConstants.END_DOCUMENT; event = headerparser.next())
+		{
+			//String prefix = headerparser.getNamespaceURI();
+			if (event == XMLStreamConstants.START_ELEMENT) {
+				localname = headerparser.getLocalName();
+				if (captureTheTag && localname == containertag) // start copy  after the tag
+					start = true;
+				if (start) { // copy header
+					String prefix = headerparser.getPrefix();
+					if (prefix.length() > 0)
+						writer.writeStartElement(Nscontext.getNamespaceURI(prefix), localname)
+					else
+						writer.writeStartElement(localname);
+					for (int i = 0 ; i < headerparser.getNamespaceCount(); i++)
+						writer.writeNamespace(headerparser.getNamespacePrefix(i), headerparser.getNamespaceURI(i));
+					for (int i = 0 ; i < headerparser.getAttributeCount(); i++)
+						writer.writeAttribute(headerparser.getAttributeLocalName(i), headerparser.getAttributeValue(i));
+				}
+				if (!captureTheTag && localname == containertag) // start copy  after the tag
+					start = true;
+			} else if (event == XMLStreamConstants.END_ELEMENT) {
+				localname = headerparser.getLocalName();
+				if (!captureTheTag && localname == containertag)
+					break;// stop looping
+
+				if (start)
+					writer.writeEndElement();
+
+				if (captureTheTag && localname == containertag)
+					break;// stop looping
+			} else if (event == XMLStreamConstants.CHARACTERS) {
+				if (start)
+					writer.writeCharacters(headerparser.getText());
+			} else if (event == XMLStreamConstants.COMMENT) {
+				if (start)
+					writer.writeComment(headerparser.getText());
+			}
+		}
+		headerparser.close();
+	}
+
+	/**
+	 * find all refs.
+	 *
+	 * @return the list of link parser
+	 */
+	private List<String> findGrpLink()
+	{
+		ArrayList<String> links = new ArrayList<String>();
+		anainputData = anaurl.openStream();
+		anaparser = anafactory.createXMLStreamReader(anainputData);
+
+		for (int event = anaparser.next(); event != XMLStreamConstants.END_DOCUMENT; event = anaparser.next()) {
+			if (event == XMLStreamConstants.START_ELEMENT) {
+				if (anaparser.getLocalName().matches("linkGrp")) {
+					String targetsvalue = anaparser.getAttributeValue(0)
+
+					if (links.contains(targetsvalue)) {
+						System.err.println("Warning: Multiple group declaration : "+targetsvalue+" has already been added, the first one will be used")
+					} else {
+						links.add(targetsvalue); // add the taxonomy type
+					}
+				} else if (anaparser.getLocalName().matches("respStmt")) {
+					respStmtID = anaparser.getAttributeValue(0); // one attribute (id) only
+				}
+			}
+		}
+		anaparser.close();
+		return links;
+	}
+
+	/**
+	 * Builds the link parsers.
+	 * I need to know what groups exists to build a parser per taxonomy and go to the first link element
+	 */
+	private void buildLinkParsers()
+	{
+		// link group of the standoff file
+		links = findGrpLink();
+		linkparsers = new HashMap<String, XMLStreamReader>();
+
+		// build one parser per link group
+		for (String link : links) { // build a parser per group
+			anainputData = new BufferedInputStream(anaurl.openStream());
+			linkparsers.put(link, anafactory.createXMLStreamReader(anainputData));
+		}
+
+		//for each parser
+		for (String link : links) {
+			anaparser = linkparsers.get(link);
+			for (int event = anaparser.next(); event != XMLStreamConstants.END_DOCUMENT; event = anaparser.next()) {
+				if (event == XMLStreamConstants.START_ELEMENT) {
+					if (anaparser.getLocalName().equals("linkGrp")) { // position the parser to the right group
+						String targetsvalue = anaparser.getAttributeValue(0)
+						if (targetsvalue.equals(link))
+							break; // next element is a link start tag
+					}
+				}
+			}
+		}
+	}
+
+	/**
+	 * get the next tei:link value of a tei:LinkGrp.
+	 *
+	 * @param link the link
+	 * @return the next ana
+	 */
+	private String getNextAnaValue(String link, String wordId)
+	{
+		anaparser = linkparsers.get(link);
+		def m;
+		for (int event = anaparser.next(); event != XMLStreamConstants.END_DOCUMENT; event = anaparser.next()) {
+			if (event == XMLStreamConstants.START_ELEMENT) {
+				if (anaparser.getLocalName().matches("link")) {
+					String targetsvalue = anaparser.getAttributeValue(0)
+					if ((m = targetsvalue =~ /#(.*) #(.*)/)) { // balise externe
+						def g1 = m[0][1];
+						def g2 = m[0][2];
+
+						String anavalue = g2;
+						anavalue = anavalue.replace("&lt;", "<")
+						return anavalue;
+					} else {
+						System.err.println("Error: getNextAna(): link target is not well formed:  = "+anaparser.getAttributeValue(0));
+					}
+				}
+			}
+		}
+		return "";
+	}
+
+	/**
+	 * build the ana tags of a word.
+	 *
+	 * @param wordId the word id
+	 * @return the ana tag
+	 */
+	private void writeAnaTag(String wordId)
+	{
+		String anabalises ="\n";
+		for (String link : links) {
+			writer.writeStartElement(TXMNS, "ana");
+			writer.writeAttribute("resp", "#"+respStmtID);
+			writer.writeAttribute("type", "#"+link);
+			writer.writeCharacters(getNextAnaValue(link, wordId));
+			writer.writeEndElement(); // txm:ana
+		}
+	}
+
+	String wordId;
+	boolean flagSourceDesc = false;
+	protected void processStartElement()
+	{
+		if (parser.getLocalName().matches("taxonomy")) {
+			String taxo = parser.getAttributeValue(0) // taxonomy type
+			presentTaxonomies.add(taxo);
+		}
+
+		for (int i= 0 ; i < parser.getAttributeCount() ;i++ ) {
+			if (parser.getAttributeLocalName(i) == "id") {
+				wordId = parser.getAttributeValue(i);
+				break
+			}
+		}
+		super.processStartElement();
+	}
+
+	boolean applicationWritten = false;
+	boolean taxonomiesWritten = false;
+	protected void processEndElement() {
+		switch (parser.getLocalName()) {
+			case "w":
+				writeAnaTag(wordId);
+				break;
+
+			case "appInfo":
+				applicationWritten = true;
+				getHeaderInfos("appInfo", false);
+				break;
+
+			case "classDecl":
+				taxonomiesWritten = true;
+				getHeaderInfos("classDecl", false);
+				break;
+
+			case "encodingDesc":
+				if (!applicationWritten) {
+					writer.writeStartElement("appInfo");
+					getHeaderInfos("appInfo", false);
+					writer.writeEndElement(); // appInfo
+				}
+				if (!taxonomiesWritten) {
+					writer.writeStartElement("classDecl");
+					getHeaderInfos("classDecl", false);
+					writer.writeEndElement(); // classDecl
+				}
+				break;
+
+			case "titleStmt":
+				if (flagSourceDesc) {
+					//output.write(this.respStmt+"\n")
+					getHeaderInfos("respStmt", true);
+					flagSourceDesc = false;
+					break;
+				}
+				break;
+		}
+		super.processEndElement();
+	}
+
+	/** The declarenamespace. */
+	boolean declarenamespace = false;
+
+	/**
+	 * Declare namespace.
+	 *
+	 * @return the java.lang. object
+	 */
+	private declareNamespace() {
+		if (!declarenamespace) {
+			writer.writeDefaultNamespace("http://www.tei-c.org/ns/1.0");
+			writer.writeNamespace("txm", TXMNS);
+			declarenamespace = true;
+		}
+	}
+
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args) {
+
+		String rootDir = "~/xml/rgaqcj/";
+		new File(rootDir + "/injection/").mkdir();
+
+		def milestones = [
+			"tagUsage",
+			"pb",
+			"lb",
+			"catRef"]// the tags who
+		File srcfile = new File(rootDir, "/anainline/", "roland.xml");
+		File pos1file = new File(rootDir, "/pos/", "rolandTT1-w-ana.xml");
+
+		File src2file = new File(rootDir, "/injection/", "roland.xml");
+		File pos2file = new File(rootDir, "/pos/", "rolandTT2-w-ana.xml");
+
+		println("process file : " + srcfile + " with : " + pos1file);
+		def builder = new AnnotationInjectionFromTTOutput(srcfile.toURI().toURL(),
+				pos1file.toURI().toURL(), milestones);
+		builder.transfomFile(new File(rootDir + "/injection/", "roland.xml"));
+
+		println("process file : " + src2file + " with : " + pos1file);
+		builder = new AnnotationInjectionFromTTOutput(src2file.toURI().toURL(), pos2file.toURI().toURL(),
+				milestones);
+		builder.transfomFile(rootDir + "/injection/", "roland-FINAL.xml");
+
+		return;
+	}
+}
Index: tmp/org.txm.core/src/java/org/txm/importer/xmltxm/package.html
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/xmltxm/package.html	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/xmltxm/package.html	(revision 881)
@@ -0,0 +1,5 @@
+<html>
+<body>
+<p>Manages xml-tei-txm files</p>
+</body>
+</html>
\ No newline at end of file

Property changes on: tmp/org.txm.core/src/java/org/txm/importer/xmltxm/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.core/src/java/org/txm/importer/xmltxm/AnnotationExtraction.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/xmltxm/AnnotationExtraction.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/xmltxm/AnnotationExtraction.groovy	(revision 881)
@@ -0,0 +1,358 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 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: 2017-01-24 18:11:42 +0100 (mar. 24 janv. 2017) $
+// $LastChangedRevision: 3400 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.xmltxm
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import javax.xml.stream.*;
+import java.net.URL;
+import org.txm.importer.filters.*;
+// TODO: Auto-generated Javadoc
+
+/**
+ * The Class AnnotationExtraction.
+ *
+ * @author mdecorde
+ * 
+ * Extract ana tags from a xml-tei-txm file
+ * saved into a stand-off file
+ */
+public class AnnotationExtraction
+{
+	/** The input data. */
+	private def inputData;
+
+	/** The factory. */
+	private def factory;
+
+	/** The parser. */
+	private XMLStreamReader parser;
+
+	/** The dir. */
+	private def dir;
+
+	/** The writer. */
+	private Writer writer;
+
+	/** The url. */
+	private def url;
+
+	/** The posfile. */
+	private def posfile;
+
+	/** The anafile. */
+	private def anafile;
+
+	/** The encoding. */
+	private def encoding;
+
+	/** The extract types. */
+	private List<String> extractTypes;
+
+	/** The resp stmt. */
+	private String respStmt;
+
+	/** The solotags. */
+	ArrayList<String> solotags;
+
+	/**
+	 * initialize.
+	 *
+	 * @param anafile the path to the xml-tei-txm file
+	 * @param posfile the output stand-off file
+	 * @param encoding the encoding of the xml-tei-txm file
+	 * @param milestones milestones tags (temporary)
+	 */
+	public AnnotationExtraction(File anafile, File posfile,String encoding,milestones) {
+		this.url = anafile.toURI().toURL();
+		this.posfile = posfile;
+		this.encoding = encoding;
+		this.solotags = milestones;
+
+		inputData = url.openStream();
+		factory = XMLInputFactory.newInstance();
+	}
+
+	/**
+	 * process !!!.
+	 */
+	public void process() {
+		assert(extractTypes != null);
+		if (this.createOutput(posfile,encoding)) {
+			this.writeHead();
+			this.writeBody( posfile, encoding);
+			this.writeTail();
+		}
+		writer.close();
+	}
+
+	/**
+	 * Creates the output.
+	 *
+	 * @param outfile the outfile
+	 * @param encoding the encoding
+	 * @return true, if successful
+	 */
+	private boolean createOutput(File outfile, String encoding){
+		try {
+			writer = new OutputStreamWriter(new FileOutputStream(outfile) , "UTF-8");
+			return true;
+		} catch (Exception e) {
+			System.out.println(e.getLocalizedMessage());
+			return false;
+		}
+	}
+
+	/**
+	 * set the respStmt tag of the stand-off file by reading the respstmt of the xml-tei-txm file.
+	 */
+	private void setResp()
+	{
+		this.respStmt = "";
+		boolean begincapture = false;
+		String lastopenlocalname= "";
+
+		inputData = url.openStream();
+		parser = factory.createXMLStreamReader(inputData);
+
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next())
+		{
+			String prefix = parser.getPrefix();
+			if (prefix == null || prefix == "")
+				prefix = "";
+			else
+				prefix +=":";
+			if (event == XMLStreamConstants.START_ELEMENT) {
+				if (parser.getLocalName().matches("resp")) {
+					String id = parser.getAttributeValue("xml","id")
+					if (id == null)
+						id = parser.getAttributeValue(null,"id")
+					if (extractTypes.contains(id)) {
+						this.respStmt = "<respStmt>\n";
+						begincapture= true;
+					}
+				}
+				if (begincapture) {
+					lastopenlocalname = parser.getLocalName();
+					respStmt += ("\n<"+prefix+parser.getLocalName());
+					for (int i= 0 ; i < parser.getAttributeCount() ;i++ )
+						respStmt += (" "+parser.getAttributeLocalName(i)+"=\""+parser.getAttributeValue(i)+"\"" );
+					if (solotags.contains(lastopenlocalname))
+						respStmt += ("/>");
+					else
+						respStmt += (">");
+				}
+			}
+			else if (event == XMLStreamConstants.END_ELEMENT) {
+				if (parser.getLocalName().matches("respStmt")) {
+					begincapture= false;
+					this.respStmt += "\n</respStmt>"
+					System.out.println(this.respStmt);
+					parser.close();
+					return;
+				} else {
+					if (!solotags.contains(parser.getLocalName()))
+						if (lastopenlocalname.equals(parser.getLocalName()))
+							respStmt += ("</"+prefix+parser.getLocalName()+">");
+						else
+							respStmt += ("\n</"+prefix+parser.getLocalName()+">");
+				}
+			} else if (event == XMLStreamConstants.CHARACTERS) {
+				String txt = parser.getText().trim();
+				respStmt += txt;
+			}
+		}
+	}
+
+	/**
+	 * write the header of the stand-off ile.
+	 */
+	private void writeHead() {
+		this.setResp();
+
+		writer.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
+		writer.write("<!DOCTYPE TEI SYSTEM \"tei_bfm_v1.dtd\">\n");
+		writer.write("<TEI xmlns:txm=\"http://textometrie.ens-lyon.fr/1.0\">\n");
+		writer.write("<teiHeader xml:lang=\"eng\">\n");
+		writer.write("<fileDesc>\n");
+		writer.write("<titleStmt>\n");
+		for (int i=0;i < extractTypes.size(); i++)
+			writer.write("<title>"+extractTypes[i]+"</title>\n");
+		writer.write(this.respStmt+"\n");
+		writer.write("</titleStmt>\n");
+		writer.write("<publicationStmt>\n");
+		writer.write("<distributor>BFM project - http://bfm.ens-lsh.fr</distributor>\n");
+		writer.write("<availability>\n");
+		writer.write("<p>(c) 2010 Projet BFM - CNRS/ENS-LSH.\n");
+		writer.write("<hi>Conditions d'utilisation</hi> : \n");
+		writer.write("Sous licence <ref target=\"http://creativecommons.org/licenses/by-sa/2.0/fr/\">Creative Commons</ref>.\n");
+		writer.write("</p>\n");
+		writer.write("</availability>\n");
+		writer.write("</publicationStmt>\n");
+		writer.write("<sourceDesc>\n");
+		writer.write("<p>born digital : TXM project - http://textometrie.org</p>\n");
+		writer.write("</sourceDesc>\n");
+		writer.write("</fileDesc>\n");
+		writer.write("</teiHeader>\n");
+		writer.write("<text xml:lang=\"fr\" type=\"standoff\">\n");
+		writer.write("<body>\n");
+		writer.write("<div>\n");
+	}
+
+	/**
+	 * write the group of ana tags with the attribute type = type.
+	 *
+	 * @param type the type
+	 */
+	private void writeGroup(String type)
+	{
+		System.out.println("write group : "+type);
+		inputData = url.openStream();
+		factory = XMLInputFactory.newInstance();
+		parser = factory.createXMLStreamReader(inputData);
+
+		boolean flagAna = false;
+		boolean flagForm = false;
+		boolean flagW = false;
+		String wordid="";
+		String vAna="";
+		String currentType;
+
+		writer.write("<linkGrp type=\""+type+"\">\n")
+
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next())
+		{
+			switch (event) {
+				case XMLStreamConstants.START_ELEMENT:
+					switch (parser.getLocalName()) {
+						case "w":
+						wordid = parser.getAttributeValue(null,"id");
+						flagW = true;
+						break;
+						case "ana":
+						if (flagW) {
+							currentType = (parser.getAttributeValue(null,"type"));
+							if (currentType.matches(type)) {
+								flagAna = true;
+								vAna ="";
+							}
+						}
+						break;
+					}
+					break;
+
+				case XMLStreamConstants.END_ELEMENT:
+					switch (parser.getLocalName()) {
+						case "w":
+						flagW = false;
+						break;
+
+						case "ana":
+						if (flagW) {
+							writer.write("<link targets=\"#"+wordid+" #"+vAna+"\"/>\n")
+							flagAna = false;
+						}
+						break;
+					}
+					break;
+
+				case XMLStreamConstants.CHARACTERS:
+					if (flagAna)
+						vAna += parser.getText().trim();//catch interp text
+					break;
+			}
+		}
+		writer.write("</linkGrp>\n");
+		parser.close();
+		inputData.close();
+	}
+
+	/**
+	 * write a group per ana type to extract from the anafile.
+	 *
+	 * @param TTrez the t trez
+	 * @param encoding the encoding
+	 * @return the java.lang. object
+	 */
+	private writeBody(File TTrez, String encoding)
+	{
+		for (String type : extractTypes) {
+			writeGroup(type);
+		}
+	}
+
+	/**
+	 * write the tail of the stand-off file = close body, text and TEI tags.
+	 */
+	private void writeTail()
+	{
+		writer.write("</div>\n");
+		writer.write("</body>\n");
+		writer.write("</text>\n");
+		writer.write("</TEI>\n");
+	}
+
+	/**
+	 * define the types to extract.
+	 *
+	 * @param types the new types to extract
+	 */
+	public void setTypesToExtract(List<String> types)
+	{
+		extractTypes = types;
+	}
+
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args) {
+
+		String rootDir = "~/xml/rgaqcj/"
+		new File(rootDir+"/extract/").mkdir()
+
+		File anafile = new File(rootDir+"/injection/","roland-ana.xml")
+		File posfile =  new File(rootDir+"/extract/","roland-pos.xml")
+		String encoding = "UTF-8"
+		//extrait les txm:ana dont la ref est dans cette liste
+		List<String> types = ["#t1","#POS"]
+
+		ArrayList<String> milestones = new ArrayList<String>()
+		//the tags you want to keep as milestones
+		milestones.add("tagUsage")
+		milestones.add("pb")
+		milestones.add("lb")
+		milestones.add("catRef")
+
+		AnnotationExtraction builder = new AnnotationExtraction(anafile,posfile,encoding,milestones)
+		builder.setTypesToExtract(types)
+		builder.process()
+		return
+	}
+}
Index: tmp/org.txm.core/src/java/org/txm/importer/xmltxm/AnnotationInjection.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/xmltxm/AnnotationInjection.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/xmltxm/AnnotationInjection.groovy	(revision 881)
@@ -0,0 +1,415 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 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: 2016-03-29 09:51:35 +0200 (mar. 29 mars 2016) $
+// $LastChangedRevision: 3185 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.xmltxm
+
+import javax.xml.stream.*
+
+import org.txm.importer.StaxIdentityParser
+import org.txm.importer.filters.*
+import org.txm.importer.PersonalNamespaceContext
+// TODO: Auto-generated Javadoc
+/**
+ * The Class AnnotationInjection.
+ *
+ * @author mdecorde
+ * 
+ * inject annotation from a stand-off file into a xml-tei-txm
+ * file
+ */
+
+public class AnnotationInjection extends StaxIdentityParser {
+
+	public static String TXMNS = "http://textometrie.org/1.0"
+
+	/** The xml reader factory. */
+	private def factory;
+
+	/** The links. */
+	private LinkedHashSet<String> links;
+	boolean replace
+
+	/** The linkparsers. key=type*/
+	private LinkedHashMap<String, XMLStreamReader> linkparsers;
+
+	/** The anaurl. */
+	private def anaurl;
+
+	/** The anainput data. */
+	private def anainputData;
+
+	/** The anafactory. */
+	private XMLInputFactory anafactory = XMLInputFactory.newInstance();
+
+	/** The anaparser. */
+	private XMLStreamReader anaparser;
+	private XMLStreamReader headerparser;
+
+	/** The resp stmt id. */
+	String respStmtID = "";
+
+	/** The present taxonomies. */
+	ArrayList<String> presentTaxonomies = new ArrayList();
+
+	/**
+	 * Instantiates a new annotation injection.
+	 *
+	 * @param url the xml-tei-txm file
+	 * @param anaurl the stand-off file
+	 */
+	public AnnotationInjection(URL url, URL anaurl) {
+		this(url, anaurl, false)
+	}
+
+	/**
+	 * Instantiates a new annotation injection.
+	 *
+	 * @param url the xml-tei-txm file
+	 * @param anaurl the stand-off file
+	 */
+	public AnnotationInjection(URL url, URL anaurl, boolean replace) {
+		super(url); // init reader and writer
+		try {
+			this.anaurl = anaurl;
+			this.replace = replace
+			factory = XMLInputFactory.newInstance();
+			this.buildLinkParsers();// build a parser per linkgroup
+		} catch (XMLStreamException ex) {
+			System.out.println(ex);
+		} catch (IOException ex) {
+			System.out.println("IOException while parsing ");
+		}
+	}
+
+	private void getHeaderInfos(String containertag, boolean captureTheTag)
+	{
+		anainputData = new BufferedInputStream(anaurl.openStream());
+		headerparser = anafactory.createXMLStreamReader(anainputData);
+		boolean start = false;
+		String localname;
+		for (int event = headerparser.next(); event != XMLStreamConstants.END_DOCUMENT; event = headerparser.next())
+		{
+			//String prefix = headerparser.getNamespaceURI();
+			if (event == XMLStreamConstants.START_ELEMENT) {
+				localname = headerparser.getLocalName();
+				if (captureTheTag && localname == containertag) // start copy  after the tag
+					start = true;
+				if (start) { // copy header
+					String prefix = headerparser.getPrefix();
+					if (prefix.length() > 0)
+						writer.writeStartElement(Nscontext.getNamespaceURI(prefix), localname)
+					else
+						writer.writeStartElement(localname);
+					for (int i = 0 ; i < headerparser.getNamespaceCount(); i++)
+						writer.writeNamespace(headerparser.getNamespacePrefix(i), headerparser.getNamespaceURI(i));
+					for (int i = 0 ; i < headerparser.getAttributeCount(); i++)
+						writer.writeAttribute(headerparser.getAttributeLocalName(i), headerparser.getAttributeValue(i));
+				}
+				if (!captureTheTag && localname == containertag) // start copy  after the tag
+					start = true;
+			} else if (event == XMLStreamConstants.END_ELEMENT) {
+				localname = headerparser.getLocalName();
+				if (!captureTheTag && localname == containertag)
+					break;// stop looping
+
+				if (start)
+					writer.writeEndElement();
+
+				if (captureTheTag && localname == containertag)
+					break;// stop looping
+			} else if (event == XMLStreamConstants.CHARACTERS) {
+				if (start)
+					writer.writeCharacters(headerparser.getText());
+			} else if (event == XMLStreamConstants.COMMENT) {
+				if (start)
+					writer.writeComment(headerparser.getText());
+			}
+		}
+		headerparser.close();
+	}
+
+	/**
+	 * find all refs.
+	 *
+	 * @return the list of link parser
+	 */
+	private LinkedHashSet<String> findGrpLink()
+	{
+		LinkedHashSet<String> links = new LinkedHashSet<String>();
+		anainputData = anaurl.openStream();
+		anaparser = anafactory.createXMLStreamReader(anainputData);
+
+		for (int event = anaparser.next(); event != XMLStreamConstants.END_DOCUMENT; event = anaparser.next()) {
+			if (event == XMLStreamConstants.START_ELEMENT) {
+				if (anaparser.getLocalName().equals("linkGrp")) {
+					String targetsvalue = anaparser.getAttributeValue(0)
+
+					if (links.contains(targetsvalue)) {
+						System.err.println("Warning: Multiple group declaration : "+targetsvalue+" has already been added, the first one will be used")
+					} else {
+						links.add(targetsvalue); // add the taxonomy type
+					}
+				} else if (anaparser.getLocalName().equals("respStmt")) {
+					respStmtID = anaparser.getAttributeValue(0); // one attribute (id) only
+				}
+			}
+		}
+		anaparser.close();
+		return links;
+	}
+
+	/**
+	 * Builds the link parsers.
+	 * I need to know what groups exists to build a parser per taxonomy and go to the first link element
+	 */
+	private void buildLinkParsers()
+	{
+		// link group of the standoff file
+		links = findGrpLink();
+		linkparsers = new LinkedHashMap<String, XMLStreamReader>();
+
+		// build one parser per link group
+		for (String link : links) { // build a parser per group
+			anainputData = new BufferedInputStream(anaurl.openStream());
+			linkparsers.put(link, anafactory.createXMLStreamReader(anainputData));
+		}
+
+		//for each parser
+		for (String link : links) {
+			anaparser = linkparsers.get(link);
+			for (int event = anaparser.next(); event != XMLStreamConstants.END_DOCUMENT; event = anaparser.next()) {
+				if (event == XMLStreamConstants.START_ELEMENT) {
+					if (anaparser.getLocalName().equals("linkGrp")) { // position the parser to the right group
+						String targetsvalue = anaparser.getAttributeValue(0)
+						if (targetsvalue.equals(link))
+							break; // next element is a link start tag
+					}
+				}
+			}
+		}
+	}
+
+	/**
+	 * get the next tei:link value of a tei:LinkGrp.
+	 *
+	 * @param link the link
+	 * @return the next ana
+	 */
+	private String getNextAnaValue(String link, String wordId)
+	{
+		anaparser = linkparsers.get(link);
+		def m;
+		for (int event = anaparser.next(); event != XMLStreamConstants.END_DOCUMENT; event = anaparser.next()) {
+			if (event == XMLStreamConstants.START_ELEMENT) {
+				if (anaparser.getLocalName().equals("link")) {
+					String targetsvalue = anaparser.getAttributeValue(0)
+					if ((m = targetsvalue =~ /#(.*) #(.*)/)) { // balise externe
+						def g1 = m[0][1];
+						def g2 = m[0][2];
+
+						String anavalue = g2;
+						anavalue = anavalue.replace("&lt;", "<")
+						return anavalue;
+					} else {
+						System.err.println("Error: getNextAna(): link target is not well formed:  = "+anaparser.getAttributeValue(0));
+					}
+				}
+			}
+		}
+		return "";
+	}
+
+	/**
+	 * build the ana tags of a word.
+	 *
+	 * @param wordId the word id
+	 * @return the ana tag
+	 */
+	private void writeAnaTags(String wordId)
+	{
+		String anabalises ="\n";
+		for (String link : links) {
+			writer.writeStartElement(TXMNS, "ana");
+			writer.writeAttribute("resp", "#"+respStmtID);
+			writer.writeAttribute("type", "#"+link);
+			if (replace) {
+				if (linkparsers.containsKey(link)) { // order is important
+					writer.writeCharacters(getNextAnaValue(link, wordId));
+				} else {
+					writer.writeCharacters(anaValues.get(link));
+				}
+			} else { // ok no problem
+				writer.writeCharacters(getNextAnaValue(link, wordId));
+			}
+			
+			writer.writeEndElement(); // txm:ana
+		}
+	}
+
+	String wordId;
+	HashMap<String, String> anaValues = new HashMap<String, String>();
+	boolean flagSourceDesc = false, flagW = false, flagAna = false;
+	String type = null, resp = null, anaValue= "";
+	protected void processStartElement()
+	{
+		if (localname.equals("taxonomy")) {
+			String taxo = parser.getAttributeValue(0) // taxonomy type
+			presentTaxonomies.add(taxo);
+		} else if (flagW && replace && localname.equals("ana")) {
+			flagAna = true
+			anaValue= ""
+			type = null
+			resp = null
+			for (int i= 0 ; i < parser.getAttributeCount() ; i++ ) {
+				if (parser.getAttributeLocalName(i) == "resp") {
+					resp = parser.getAttributeValue(i);
+				} else if (parser.getAttributeLocalName(i) == "type") {
+					type = parser.getAttributeValue(i);
+				}
+			}
+			if (type != null) type = type.substring(1);
+			if (resp != null) resp = resp.substring(1);
+			return; // don't write the "ana" start element
+		} else if (localname.equals("w")) {
+			for (int i= 0 ; i < parser.getAttributeCount() ; i++ ) {
+				if (parser.getAttributeLocalName(i) == "id") {
+					wordId = parser.getAttributeValue(i);
+					break
+				}
+			}
+			flagW = true
+			anaValues.clear()
+		}
+
+		super.processStartElement();
+	}
+
+	protected void processCharacters() {
+		if (flagAna) anaValue += parser.getText();
+		else super.processCharacters(); // FORM CONTENT LOST !!!!!!!!!!!!!
+	};
+
+	boolean applicationWritten = false;
+	boolean taxonomiesWritten = false;
+	protected void processEndElement() {
+		switch (parser.getLocalName()) {
+			case "w":
+				writeAnaTags(wordId);
+				flagW = false
+				break;
+			case "ana":
+				if (flagAna && replace && type != null && resp != null && anaValue != null) {
+					anaValues.put(type, anaValue)
+					links.add(type)
+					flagAna = false
+					return; // don't write the "ana" end element
+				}
+				flagAna = false
+				break;
+
+			case "appInfo":
+				applicationWritten = true;
+				getHeaderInfos("appInfo", false);
+				break;
+
+			case "classDecl":
+				taxonomiesWritten = true;
+				getHeaderInfos("classDecl", false);
+				break;
+
+			case "encodingDesc":
+				if (!applicationWritten) {
+					writer.writeStartElement("appInfo");
+					getHeaderInfos("appInfo", false);
+					writer.writeEndElement(); // appInfo
+				}
+				if (!taxonomiesWritten) {
+					writer.writeStartElement("classDecl");
+					getHeaderInfos("classDecl", false);
+					writer.writeEndElement(); // classDecl
+				}
+				break;
+
+			case "titleStmt":
+				if (flagSourceDesc) {
+					//output.write(this.respStmt+"\n")
+					getHeaderInfos("respStmt", true);
+					flagSourceDesc = false;
+					break;
+				}
+				break;
+		}
+		super.processEndElement();
+	}
+
+	/** The declarenamespace. */
+	boolean declarenamespace = false;
+
+	/**
+	 * Declare namespace.
+	 *
+	 * @return the java.lang. object
+	 */
+	private declareNamespace() {
+		if (!declarenamespace) {
+			writer.writeDefaultNamespace("http://www.tei-c.org/ns/1.0");
+			writer.writeNamespace("txm", TXMNS);
+			declarenamespace = true;
+		}
+	}
+
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args) {
+
+		String rootDir = "~/xml/rgaqcj/";
+		new File(rootDir + "/injection/").mkdir();
+
+		def milestones = ["tagUsage", "pb", "lb","catRef"]// the tags who
+
+		File srcfile = new File(rootDir, "/anainline/", "roland.xml");
+		File pos1file = new File(rootDir, "/pos/", "rolandTT1-w-ana.xml");
+
+		File src2file = new File(rootDir, "/injection/", "roland.xml");
+		File pos2file = new File(rootDir, "/pos/", "rolandTT2-w-ana.xml");
+
+		println("process file : " + srcfile + " with : " + pos1file);
+		def builder = new AnnotationInjection(srcfile.toURI().toURL(),
+				pos1file.toURI().toURL(), milestones);
+		builder.transfomFile(new File(rootDir + "/injection/", "roland.xml"));
+
+		println("process file : " + src2file + " with : " + pos1file);
+		builder = new AnnotationInjection(src2file.toURI().toURL(), pos2file.toURI().toURL(),
+				milestones);
+		builder.transfomFile(rootDir + "/injection/", "roland-FINAL.xml");
+
+		return;
+	}
+}
Index: tmp/org.txm.core/src/java/org/txm/importer/xmltxm/BuildTTSrc.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/xmltxm/BuildTTSrc.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/xmltxm/BuildTTSrc.groovy	(revision 881)
@@ -0,0 +1,217 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 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: 2017-01-24 18:11:42 +0100 (mar. 24 janv. 2017) $
+// $LastChangedRevision: 3400 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.xmltxm
+
+import java.text.DateFormat;
+import java.util.Date;
+import java.util.ArrayList;
+import javax.xml.stream.*;
+import java.net.URL;
+
+import org.txm.Toolbox;
+import org.txm.importer.filters.*;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class BuildTTSrc.
+ *
+ * @author mdecorde
+ * build the TT source for tigerSearch
+ */
+
+public class BuildTTSrc {
+	
+	/** The url. */
+	private def url;
+	
+	/** The input data. */
+	private def inputData;
+	
+	/** The factory. */
+	private def factory;
+	
+	/** The parser. */
+	private XMLStreamReader parser;
+	
+	/** The output. */
+	private BufferedWriter output;
+	
+	/**
+	 * Instantiates a new builds the tt src.
+	 * uses XML-TXM V2
+	 *
+	 * @param url the url of the file to process
+	 */
+	public BuildTTSrc(URL url) {
+		try {
+			this.url = url;
+			inputData = url.openStream();
+			factory = XMLInputFactory.newInstance();
+			parser = factory.createXMLStreamReader(inputData);
+			
+		} catch (XMLStreamException ex) {
+			System.out.println(ex);
+		} catch (IOException ex) {
+			System.out.println("IOException while parsing ");
+		}
+	}
+	
+	/**
+	 * Creates the output.
+	 *
+	 * @param outfile the outfile
+	 * @return true, if successful
+	 */
+	private boolean createOutput(File outfile) {
+		try {
+			File f = outfile;
+			output = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outfile),
+					"UTF-8"));
+			return true;
+		} catch (Exception e) {
+			System.out.println(e.getLocalizedMessage());
+			return false;
+		}
+	}
+	
+	/**
+	 * Process.
+	 *
+	 * @param outfile the outfile
+     * @param formtype, if multiple form, use this param to choose the correct one, if null takes the first form found
+	 * @return true, if successful
+	 */
+	public boolean process(File outfile, String formtype) {
+		if (!createOutput(outfile))
+			return false;
+		
+		boolean flagform = false; // to catch the content of the form tag
+		boolean firstform = false; // to know if its the first form of the w element
+		String form = ""; // the content of the form tag
+		String lastopenlocalname = "";
+		String localname = "";
+		StringBuffer buffer = new StringBuffer();
+		try {
+			for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+				switch (event) {
+					case XMLStreamConstants.START_ELEMENT:
+						localname = parser.getLocalName();
+						switch (localname) {
+							case "w":
+								//firstform = true;
+								break;
+							case "form":
+//								if (firstform) {
+//									if (formtype != null) {
+//										if(parser.getAttributeCount() > 0 
+//											&& parser.getAttributeValue(0).equals(formtype)) // only one attribute in form, type
+//											flagform = true;
+//									}
+//									else
+									flagform = true;
+									form = "";
+									firstform = false;
+								//}
+								break;
+							case "s": // TreeTagger can use s tags
+								buffer.append("<s>\n");
+								break;
+						}
+						break;
+					case XMLStreamConstants.END_ELEMENT:
+						localname = parser.getLocalName();
+						switch (localname) {
+							case "form":
+								flagform = false;
+								form = form.trim()
+								if (form.length() == 0) buffer.append("__EMPTY__\n");
+								else buffer.append(form.replace("\n", "").replace("<", "&lt;")+ "\n");
+								//buffer.append(form+ "\n"); // its a txt file no need to use entities
+								break;
+							
+							case "s":
+								buffer.append("</s>\n");
+								break;
+						}
+						break;
+					
+					case XMLStreamConstants.CHARACTERS:
+						if (flagform) {
+							if (parser.getText().length() > 0)
+								form += parser.getText();
+						}
+						break;
+				}
+			}
+
+			String str = buffer.toString()
+			if ("false".equals(Toolbox.getPreference(Toolbox.TREETAGGER_APOSTROPHE))) {
+				str = str.replace("’", "'").replace("‘", "'");
+			}
+			output.write(str)
+			output.close();
+			parser.close();
+			inputData.close();
+		} catch (Exception ex) {
+			System.out.println(ex);
+			return false;
+		} 
+		
+		return true;
+	}
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args) {
+		
+		String rootDir = "~/xml/rgaqcj/";
+		// new File(rootDir+"/identity/").mkdir();
+		
+		ArrayList<String> milestones = new ArrayList<String>();// the tags who
+		// you want them
+		// to stay
+		// milestones
+		milestones.add("tagUsage");
+		milestones.add("pb");
+		milestones.add("lb");
+		milestones.add("catRef");
+		
+		File srcfile = new File(rootDir + "anainline/", "roland-p5.xml");
+		File resultfile = new File(rootDir + "ttsrc/", "roland-p5.tt");
+		println("build ttsrc file : " + srcfile + " to : " + resultfile);
+		
+		def builder = new BuildTTSrc(srcfile.toURL(), milestones);
+		builder.process(resultfile);
+		
+		return;
+	}
+	
+}
Index: tmp/org.txm.core/src/java/org/txm/importer/xmltxm/Xml2Ana.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/xmltxm/Xml2Ana.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/xmltxm/Xml2Ana.groovy	(revision 881)
@@ -0,0 +1,577 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 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: 2017-04-19 16:23:38 +0200 (mer. 19 avril 2017) $
+// $LastChangedRevision: 3430 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.xmltxm
+
+import org.txm.importer.HasElement;
+import org.txm.importer.StaxIdentityParser;
+
+import java.text.DateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Locale;
+
+import javax.xml.stream.*;
+
+import java.net.URL;
+
+import org.txm.importer.filters.*;
+import org.txm.utils.AsciiUtils;
+
+/**
+ * The Class Xml2Ana.
+ *
+ * @author mdecorde
+ * transform : pre xml-tei file >> xml-tei-txm file
+ * The pre xml-tei file must contains a minimal teiHeader with classDecl, encodingDesc and titleStmt
+ * 
+ * you must specify the correspondance between word attributs and ana types&respStmtIDs
+ * then the attributes of w tags will be transformed into interp tag
+ */
+public class Xml2Ana extends StaxIdentityParser
+{
+	/** The dir. */
+	private def dir;
+
+	/** The convert all attributes. */
+	private boolean convertAllAttributes = false;
+
+	/** The corresp type. */
+	HashMap<String,String> correspType;
+
+	/** The corresp ref. */
+	HashMap<String,String> correspRef;
+
+	/** The check tags. */
+	HashMap<String,Boolean> checkTags = new HashMap<String,Boolean>();
+
+	/** The resp id. */
+	def respId = [];
+
+	/** The applications. */
+	HashMap<String,File> applications;
+
+	/** The taxonomies. */
+	HashMap<String,String[]> taxonomies;
+
+	/** The resps. */
+	HashMap<String,String[]> resps;
+
+	/** The items. */
+	HashMap<String,HashMap<String,String>> items;
+
+	/** The XML headeradded. */
+	boolean XMLHeaderadded = false;
+	String textname;
+	String wtag = "w";
+	
+	public static final String TEXT = "text"
+	public static final String ID = "id"
+
+	/**
+	 * Instantiates a new xml2 ana.
+	 *
+	 * @param url the url
+	 * @param wordprefix the wordprefix
+	 */
+	public Xml2Ana(File file) {
+		super(file.toURI().toURL());
+		//File file = new File(url.getFile()).getAbsoluteFile()
+		textname = file.getName();
+		int idx = textname.lastIndexOf(".");
+		if (idx > 0)
+			textname = textname.substring(0, idx)
+
+		
+		checkTags.put("respStmt",false);
+		checkTags.put("titleStmt",false);
+		checkTags.put("appInfo",false);
+
+		hasText = new HasElement(file, TEXT).process();
+	}
+
+	/**
+	 * Sets the convert all atrtibutes.
+	 *
+	 * @param value the value
+	 * @return the java.lang. object
+	 */
+	public setConvertAllAtrtibutes(boolean value) {
+		convertAllAttributes = value;
+	}
+	
+	/**
+	 * Sets the convert all atrtibutes.
+	 *
+	 * @param value the value
+	 * @return the java.lang. object
+	 */
+	public setWordTag(String wtag) {
+		this.wtag = wtag
+	}
+
+	int idcount = 0;
+	boolean flagWord = false;
+	int firstElement = 0;
+	boolean teiElementAdded = false;
+	boolean teiHeaderElementAdded = false;
+	boolean hasText = false;
+	boolean textElementAdded = false;
+	def anabalises = [];
+	protected void processStartElement()
+	{
+//		println "checkTags=$checkTags";
+//		println "parser=$parser";
+		firstElement++;
+		
+		if (this.checkTags.containsKey(parser.getLocalName())) {
+			this.checkTags.put(parser.getLocalName(), true);
+		}
+		
+		switch (parser.getLocalName()) {
+			case wtag:
+				if (!hasText) {
+					writer.writeStartElement(TEXT);
+					writer.writeAttribute(ID, textname);
+					textElementAdded = true;
+					hasText = true;
+				}
+				idcount++; // increment word counter
+				anabalises.clear();
+
+				writer.writeStartElement(parser.getLocalName()); // write w
+
+				for (int i = 0 ; i < parser.getNamespaceCount() ; i++) // write namespaces
+					writer.writeNamespace(parser.getNamespacePrefix(i), parser.getNamespaceURI(i));
+
+				for (int i= 0 ; i < parser.getAttributeCount() ;i++ ) { // transform attributes
+					String type = parser.getAttributeLocalName(i);
+					String value = parser.getAttributeValue(i);
+					if (correspType.containsKey(type)) { // check if txm:ana
+						String corresptype = correspType.get(type);
+						String ref = correspRef.get(type);
+						anabalises.add(["#"+ref, "#"+corresptype, value]);
+					} else if (type == ID) { // keep id attribute 
+						String wordid = value
+						if (wordid.startsWith("w")) {
+							if (!wordid.startsWith("w_"))
+								wordid = "w_"+wordid.substring(1)
+						} 
+//						else {
+//							wordid = "w_"+textname+"_"+wordid;
+//						}
+						
+						wordid = AsciiUtils.buildAttributeId(wordid); // remove characters not compatible with the id attribute value
+						
+						writer.writeAttribute(type, wordid);
+						
+					} else { // add attributes that was in the original <w>
+						if (convertAllAttributes)
+							anabalises.add(["none","#"+type, value])
+						else
+							writer.writeAttribute(type, value);
+					}
+				}
+
+				flagWord = true; // start to capture the form
+				writer.writeStartElement(TXMNS, "form");
+				break;
+
+			case "TEI":
+				super.processStartElement();
+				boolean hasTeiNS = false;
+				boolean hasTXMNs = false;
+				for (int i = 0 ; i < parser.getNamespaceCount() ; i++) {
+					if (parser.getNamespaceURI(i) == TXMNS)
+						hasTXMNs = true;
+					else if (parser.getNamespaceURI(i) == TEINS)
+						hasTeiNS = true;
+				}
+				if (!hasTeiNS) {
+					writer.writeDefaultNamespace(TEINS);
+				}
+				if (!hasTXMNs)
+					writer.writeNamespace(TXM, TXMNS);
+				break;
+
+			default:
+
+				if (TEXT.equals(localname)) {
+					hasText = true;
+				}
+
+				if (firstElement == 1) { // test if first element is TEI
+					//println "first tag: "+parser.getLocalName()
+					if (localname != "TEI") { // "TEI" is missing
+						teiElementAdded = true;
+						addTEIElement();
+					} else if (!hasText) {
+						writer.writeStartElement(TEXT);
+						writer.writeAttribute(ID, textname);
+						textElementAdded = true;
+						hasText = true;
+					}
+				}
+				if (firstElement == 2 && teiElementAdded != true) {
+					//println "second tag: "+parser.getLocalName()
+					if (localname != "teiHeader") { // teiHeader is missing
+						writeTeiHeader();
+						hasTeiHeader = true
+						teiHeaderElementAdded = true
+					}
+				} else if (!hasText & (teiElementAdded | teiHeaderElementAdded)) {
+					writer.writeStartElement(TEXT);
+					writer.writeAttribute(ID, textname);
+					textElementAdded = true;
+					hasText = true;
+				}
+
+				super.processStartElement();
+				if (TEXT.equals(localname)) {
+					if (!parser.getAttributeValue(null, ID)) {
+						writer.writeAttribute(ID, textname);
+					}
+				}
+		}
+	}
+
+	protected void after()
+	{
+		if (textElementAdded) {
+			writer.writeEndElement(); // text
+		}
+		if (teiElementAdded) {
+			writer.writeEndElement(); // TEI
+		}
+		super.after(); // close writer, parser, etc
+	}
+
+	protected void addTEIElement()
+	{
+		writer.writeStartElement("TEI");
+		writer.writeDefaultNamespace(TEINS);
+		writer.writeNamespace(TXM, TXMNS);
+		writer.writeNamespace(TEI, TEINS);
+		writeTeiHeader();
+	}
+
+	protected void processCharacters()
+	{
+		if (flagWord) {
+			writer.writeCharacters(parser.getText().trim()); // keep form in 1 line
+		} else {
+			super.processCharacters();
+		}
+	}
+	
+	boolean hasClassDecl = false;
+	boolean hasFileDesc = false;
+	boolean hasEncodingDesc = false;
+	boolean hasTeiHeader = false;
+	boolean hasTEI = false;
+	public static String ANA = "ana"
+	public static String RESP = "resp"
+	public static String TYPE = "type"
+	protected void processEndElement()
+	{
+		switch (parser.getLocalName()) {
+			case wtag:
+				writer.writeEndElement(); // txm:form
+				for (def values : anabalises)
+				{// <txm:ana resp=ref type=corresptype>value</txm:ana>
+					writer.writeStartElement(TXMNS, ANA);
+					writer.writeAttribute(RESP, values[0]);
+					writer.writeAttribute(TYPE, values[1]);
+					writer.writeCharacters(values[2]);
+					writer.writeEndElement(); // txm:ana
+				}
+
+				flagWord = false;
+				break;
+
+			case "fileDesc":
+				hasFileDesc = true;
+				this.writeTXMResps();
+				break;
+
+			case "classDecl":
+				hasClassDecl=true;
+				this.writeTXMTaxonomies();
+				break;
+			case "encodingDesc":
+				hasEncodingDesc = true;
+				writeContentOfEncodingDesc();
+				break;
+
+			case "teiHeader":
+				hasTeiHeader = true
+				if (!hasEncodingDesc) {
+					writer.writeStartElement("encodingDesc");
+					writeContentOfEncodingDesc();
+					writer.writeEndElement();
+				}
+
+				break;
+			case "TEI":
+				hasTEI = true;
+				if (!hasTeiHeader) {
+					writeTeiHeader();
+				}
+				break;
+		}
+
+		super.processEndElement();
+	}
+
+	protected void writeTeiHeader()
+	{
+		writer.writeStartElement("teiHeader");
+		writer.writeStartElement("fileDesc")
+		this.writeTXMResps();
+		writer.writeStartElement("titleStmt")
+		writer.writeStartElement("title")
+		writer.writeEndElement(); // title
+		writer.writeEndElement(); // titleStmt
+		writer.writeStartElement("publicationStmt")
+		writer.writeEndElement(); // publicationStmt
+		writer.writeStartElement("sourceDesc")
+		writer.writeEndElement(); // sourceDesc
+		writer.writeEndElement(); // fileDesc
+		writer.writeStartElement("encodingDesc");
+		writeContentOfEncodingDesc();
+		writer.writeEndElement(); // encodingDesc
+		writer.writeEndElement(); // teiHeader
+	}
+
+	protected void writeContentOfEncodingDesc()
+	{
+		writer.writeStartElement("appInfo")
+		this.writeTXMApps();
+		writer.writeEndElement(); // appInfo
+		if (!hasClassDecl) {
+			writer.writeStartElement("classDecl");
+			this.writeTXMTaxonomies();
+			writer.writeEndElement(); // classDecl
+		}
+	}
+
+	/**
+	 * Check resp.
+	 *
+	 * @return the string
+	 */
+	public String checkResp()
+	{
+		String rez ="found tags : \n";
+		for (String key : checkTags.keySet())
+			rez += "\t"+key+"\n";
+		return rez;
+	}
+
+	/**
+	 * Sets the correspondances.
+	 *
+	 * @param correspRef the corresp ref
+	 * @param correspType the corresp type
+	 */
+	public void setCorrespondances(correspRef, correspType)
+	{
+		this.correspRef = correspRef;
+		this.correspType = correspType;
+	}
+
+	/**
+	 * Sets the header infos.
+	 *
+	 * @param respId the resp id
+	 * @param resps the resps
+	 * @param applications the applications
+	 * @param taxonomies the taxonomies
+	 * @param items the items
+	 */
+	public void setHeaderInfos(respId,resps, applications, taxonomies, items)
+	{
+		this.respId = respId
+		this.resps = resps
+		this.applications = applications
+		this.taxonomies = taxonomies;
+		this.items = items;
+	}
+
+	/**
+	 * Write txm resps.
+	 */
+	public void writeTXMResps()
+	{
+		for (String ref : respId) {
+			String[] infos = resps.get(ref);
+			writer.writeStartElement("respStmt");
+			writer.writeStartElement(RESP);
+			writer.writeAttribute(ID,ref);
+			writer.writeCharacters(infos[0]);
+			writer.writeStartElement("date");
+			writer.writeAttribute("when",infos[2]);
+			writer.writeCharacters(infos[3]);
+			writer.writeEndElement(); // date
+			writer.writeEndElement(); //resp
+			writer.writeStartElement("name");
+			writer.writeAttribute(TYPE, "person");
+			writer.writeCharacters(infos[1])
+			writer.writeEndElement(); // name
+			writer.writeEndElement(); //respStmt
+		}
+	}
+
+	/**
+	 * Write txm apps.
+	 */
+	public void writeTXMApps()
+	{
+		for (String ref : respId) {
+			List<String> list= applications.get(ref);
+			String ident = list.get(0);
+			String version = list.get(1);
+			File report = list.get(2);
+
+			writer.writeStartElement(TXMNS, "application");
+			writer.writeAttribute("ident", ident);
+			writer.writeAttribute("version", version);
+			writer.writeAttribute(RESP, ref);
+
+			//get txm:commandLine from GeneratedReport
+			if (report != null) {
+				writer.writeCharacters("");writer.flush();
+				Reader reader = new FileReader(report);
+				String line = reader.readLine();
+				while (line != null) {
+					if (line.length() != 0)
+						output.write(line+"\n");
+					line = reader.readLine();
+				}
+				reader.close();
+			}
+
+			writer.writeStartElement("ab");
+			writer.writeAttribute(TYPE, "annotation");
+			for (String item : taxonomies.get(ref)) {
+				writer.writeStartElement("list");
+				writer.writeEmptyElement("ref");
+				writer.writeAttribute(TYPE, "tagset");
+				writer.writeAttribute("target", item);
+				writer.writeEndElement(); // list
+			}
+			writer.writeEndElement(); // ab
+			writer.writeEndElement(); // txm:application
+		}
+	}
+
+	/**
+	 * Write txm taxonomies.
+	 */
+	public void writeTXMTaxonomies()
+	{
+		for (String tax : items.keySet()) {
+			writer.writeStartElement("taxonomy");
+			writer.writeAttribute(ID, tax);
+
+			writer.writeStartElement("bibl");
+			writer.writeAttribute(TYPE, "tagset");
+			writer.writeStartElement("title");
+			writer.writeCharacters(tax);
+			writer.writeEndElement(); // title
+
+			for (String type : items.get(tax).keySet()) {
+				writer.writeEmptyElement("ref");
+				writer.writeAttribute(TYPE, type);
+				writer.writeAttribute("target", items.get(tax).get(type));
+			}
+			writer.writeEndElement(); // bibl
+			writer.writeEndElement(); // taxonomy
+		}
+	}
+
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args) {
+
+		String rootDir = "~/xml/rgaqcj/";
+		new File(rootDir+"anainline/").mkdir();
+
+		ArrayList<String> milestones = new ArrayList<String>();
+
+		String file = "roland-p5.xml";
+		String anafile = "roland-p5.xml";
+
+		def correspType = new HashMap<String,String>()
+		// correspType(attribut word wlx, attribut type de la propriété ana du w txm)
+		correspType.put("p2","CATTEX2009");
+
+		def correspRef = new HashMap<String,String>()
+		// correspRef (attribut word wlx, attribut ref de la propriété ana du w txm. ref pointe vers l'identifiant du respStmt du TEIheader)
+		correspRef.put("p2","ctx1");
+
+		//il faut lister les id de tous les respStmt
+		def respId = ["ctx1"];//,"TT1", "TnT1"];
+
+		//fait la correspondance entre le respId et le rapport d'execution de l'outil
+		def applications = new HashMap<String,HashMap<String,String>>();
+		applications.put("ctx1",new ArrayList<String>());
+		applications.get("ctx1").add("Oxygen");//app ident
+		applications.get("ctx1").add("9.3");//app version
+		applications.get("ctx1").add(null);//app report file path
+
+		//fait la correspondance entre le respId et les attributs type de la propriété ana du w txm
+		//pour construire les ref vers les taxonomies
+		def taxonomiesUtilisees = new HashMap<String,String[]>();
+		taxonomiesUtilisees.put("ctx1",["CATTEX2009"]);//,"lemma","lasla","grace"]);
+
+		//associe un id d'item avec sa description et son URI
+		def itemsURI = new HashMap<String,HashMap<String,String>>();
+		itemsURI.put("CATTEX2009",new HashMap<String,String>());
+		itemsURI.get("CATTEX2009").put("tagset","http://bfm.ens-lsh.fr/IMG/xml/cattex2009.xml");
+		itemsURI.get("CATTEX2009").put("website","http://bfm.ens-lsh.fr/article.php3?id_article=176");
+
+		//informations de respStmt
+		//resps (respId <voir ci-dessus>, [description, person, date])
+		def resps = new HashMap<String,String[]>();
+		resps.put("ctx1", ["initial tagging","alavrentiev","2010-03-02","Tue Mar  2 21:02:55 Paris, Madrid 2010"])
+
+		//lance le traitement
+		def builder = new Xml2Ana(new File(rootDir+"/src/",file));
+		builder.setCorrespondances(correspRef, correspType);
+		builder.setHeaderInfos(respId,resps, applications, taxonomiesUtilisees, itemsURI)
+		//dossier de sortie + nom fichier sortie
+		builder.process(anafile);
+
+		return
+	}
+
+}
Index: tmp/org.txm.core/src/java/org/txm/importer/xmltxm/CSV2W_ANA.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/xmltxm/CSV2W_ANA.groovy	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/xmltxm/CSV2W_ANA.groovy	(revision 881)
@@ -0,0 +1,491 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 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: 2016-03-29 09:51:35 +0200 (mar. 29 mars 2016) $
+// $LastChangedRevision: 3185 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.xmltxm
+
+import java.io.File;
+import java.io.Writer;
+
+import org.txm.importer.PersonalNamespaceContext;
+import org.txm.utils.treetagger.TreeTagger;
+import java.util.Iterator;
+
+import javax.xml.namespace.NamespaceContext;
+
+import java.io.FileInputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.nio.charset.Charset;
+import java.util.Iterator;
+
+import javax.xml.stream.*;
+// TODO: Auto-generated Javadoc
+/**  
+ * @author mdecorde  
+ * 
+ * Take a CVS file with columns [word, pos1, pos2, ...] Build xml-pos With given infos : - setAnnotationTypes( types, idform); - setResp( person, software, cmdLine);  types : list of type [pos1, pos2, ...] idform : the ___ of the words' id person : the resp software : the software which creates annotations cmdline : the used cmd line 
+ * 
+ */
+class CSV2W_ANA {
+	String encoding;
+
+	/** The target. */
+	String target = "" // ana file targeted
+
+	/** The distributor. */
+	String distributor= "";
+
+	/** The publi chat. */
+	String publiChat= "";
+
+	/** The source chat. */
+	String sourceChat= "";
+
+	/** The reportfile. */
+	File reportfile;
+
+	/** The resp person. */
+	String respPerson; // used for respStmt/resp/name(person)
+
+	/** The resp id. */
+	String respId;
+
+	/** The resp chat. */
+	String respChat;
+
+	/** The resp date. */
+	String respDate;
+
+	/** The resp when. */
+	String respWhen;
+
+	/** The app ident. */
+	String appIdent;
+
+	/** The app version. */
+	String appVersion;
+
+	/** The types. */
+	def types ;// used for linkGrp type
+
+	/** The types desc. */
+	def typesDesc ;// used for types' description
+
+	/** The types uri. */
+	def typesURI; // used for types' URI
+
+	/** The types web. */
+	def typesWEB;//used for types siteweb
+
+	/** The idform. */
+	String idform ="";
+
+	/** The writer. */
+	XMLOutputFactory factory = XMLOutputFactory.newInstance();
+	BufferedOutputStream output;
+	XMLStreamWriter writer;
+
+	public static String TXMNS = "http://textometrie.org/1.0";
+	public static String TEINS = "http://www.tei-c.org/ns/1.0";
+
+	/**
+	 * Process.
+	 *
+	 * @param TTrez the tt result file
+	 * @param xmlform the xmlform the standoff file created
+	 * @param encoding the encoding of the result file
+	 * @return true, if successful
+	 */
+	public boolean process(File TTrez,File xmlform, String encoding )
+	{
+		try {
+			this.encoding = encoding;
+			output = new BufferedOutputStream(new FileOutputStream(xmlform));
+			writer = factory.createXMLStreamWriter(output, "UTF-8"); // create a new file
+			writer.setNamespaceContext(new PersonalNamespaceContext());
+			writeHead();
+			writeBody(TTrez,encoding)
+			writeTail();
+			writer.close();
+			output.close();
+		} catch(Exception e) {
+			e.printStackTrace();
+			writer.close();
+			output.close();
+			return false;
+		}
+		return true;
+	}
+
+	/**
+	 * Write head.
+	 */
+	private void writeHead()
+	{
+		Charset UTF8 = Charset.forName("UTF8");
+		writer.writeStartDocument(encoding, "1.0");
+		writer.writeStartElement("TEI");
+		writer.writeDefaultNamespace(TEINS);
+		writer.writeNamespace("txm", TXMNS);
+		writer.writeStartElement("teiHeader");
+		writer.writeStartElement("fileDesc");
+		writer.writeStartElement("titleStmt");
+		writer.writeStartElement("title");
+		writer.writeCharacters("Standoff annotation file for "+target);
+		writer.writeEndElement(); // title
+		writer.writeStartElement("respStmt");
+		writer.writeAttribute("xml:id", respId);
+		writer.writeStartElement("resp");
+		writer.writeCharacters(respChat)
+		writer.writeStartElement("date");
+		writer.writeAttribute("when", respWhen);
+		writer.writeCharacters(respDate);
+		writer.writeEndElement(); // date
+		writer.writeEndElement(); // resp
+		writer.writeStartElement("name");
+		writer.writeAttribute("type", "person");
+		writer.writeCharacters(respPerson+"\n");
+		writer.writeEndElement(); // name
+		writer.writeEndElement(); // respStmt
+		writer.writeEndElement(); // titleStmt
+		writer.writeStartElement("publicationStmt")
+		writer.writeCharacters("\n");
+		writer.writeStartElement("distributor");
+		writer.writeCharacters("\n");
+		writer.flush();
+		output.write(distributor.getBytes(UTF8))
+		output.flush()
+		writer.writeEndElement(); // distributor
+		writer.writeCharacters("\n");
+		writer.flush();
+		output.write(publiChat.getBytes(UTF8));
+		output.flush()
+		writer.writeEndElement(); // publicationStmt
+		writer.writeStartElement("sourceDesc");
+		writer.writeCharacters("\n");
+		writer.flush();
+		output.write(sourceChat.getBytes(UTF8));
+		output.flush()
+		writer.writeEndElement(); // sourceDesc
+		writer.writeEndElement(); // fileDesc
+		writer.writeStartElement("encodingDesc");
+		writer.writeStartElement("appInfo");
+		writer.writeStartElement(TXMNS,"application");
+		writer.writeAttribute("ident",appIdent);
+		writer.writeAttribute("version", appVersion);
+		writer.writeAttribute("resp", respId);
+		writer.writeCharacters("\n");
+		writer.flush();
+		def report = this.reportfile;
+		if (report != null) {
+			//System.out.println("read report : "+report);
+			Reader reader = new FileReader(report);
+			String line = reader.readLine();
+			while (line != null) {
+				if (line.length() != 0)
+					output.write((line.replace("&","&amp;")+"\n").getBytes(UTF8));
+				line = reader.readLine();
+			}
+			reader.close();
+			output.flush()
+		} else {
+			writer.writeEmptyElement(TXMNS, "commandLine");
+			writer.writeCharacters("\n");
+		}
+
+		writer.writeStartElement("ab");
+		writer.writeAttribute("type", "annotation");
+		writer.writeCharacters("\n");
+		writer.writeStartElement("list");
+		writer.writeCharacters("\n");
+		for (int i = 0; i < types.size(); i++) {
+			writer.writeStartElement("item");
+			writer.writeEmptyElement("ref");
+			writer.writeAttribute("type", "tagset");
+			writer.writeAttribute("target","#"+types[i])
+			writer.writeEndElement(); // item
+			writer.writeCharacters("\n");
+		}
+		writer.writeEndElement(); // list
+		writer.writeEndElement(); // ab
+		writer.writeEndElement(); // txm:application
+		writer.writeEndElement(); // appInfo
+		writer.writeStartElement("classDecl");
+		for (int i = 0; i < types.size(); i++) {
+			writer.writeStartElement("taxonomy");
+			writer.writeAttribute("xml:id", types[i]);
+			writer.writeStartElement("bibl");
+			writer.writeStartElement("title");
+			writer.writeCharacters(typesDesc[i]);
+			writer.writeEndElement(); // title
+			if (!typesURI[i].equals("")) {
+				writer.writeEmptyElement("ref");
+				writer.writeAttribute("type", "tagset");
+				writer.writeAttribute("target", typesURI[i]);
+				writer.writeCharacters("\n");
+			}
+			if (!typesWEB[i].equals("")) {
+				writer.writeEmptyElement("ref");
+				writer.writeAttribute("type", "siteweb");
+				writer.writeAttribute("target", typesWEB[i]);
+				writer.writeCharacters("\n");
+			}
+			writer.writeEndElement(); // bibl
+			writer.writeCharacters("\n");
+			writer.writeEndElement(); // taxonomy
+			writer.writeCharacters("\n");
+		}
+		writer.writeEndElement(); // classDecl
+		writer.writeCharacters("\n");
+		writer.writeEndElement(); // encodingDesc
+		writer.writeCharacters("\n");
+		writer.writeEndElement(); // teiHeader
+
+		writer.writeStartElement("text");
+		writer.writeAttribute("type", "standoff");
+		writer.writeStartElement("body");
+		writer.writeCharacters("\n");
+		writer.writeStartElement("div");
+		writer.writeCharacters("");
+	}
+
+	/**
+	 * Write body.
+	 *
+	 * @param TTrez the tt result file
+	 * @param encoding the encoding
+	 * @return the java.lang. object
+	 */
+	private writeBody(File TTrez, String encoding) {
+		String tmp = "";
+		String targets= idform+"";
+
+		//def content = TTrez.getText(encoding)
+		//content = content.replace("&lt;", "<")
+
+		def separator= "\t"
+		def maxsize = types.size()+1;
+		for (int i = 0 ; i< types.size() ; i++) {
+			int id = 1;
+			//output.write("<linkGrp type=\""+types[i]+"\">\n");
+			writer.writeStartElement("linkGrp");
+			writer.writeAttribute("type", types[i]);
+			TTrez.eachLine("UTF-8") { line ->
+				line = line.replaceAll("&lt;", "<")
+				def fields = line.split(separator);
+				//content.splitEachLine(separator) {fields ->
+					if (fields.size() == maxsize)
+						if (!(fields[0].startsWith("<s>") || fields[0].startsWith("</s>")))// don't use the sentence tags
+					{
+						writer.writeEmptyElement("link");
+						writer.writeAttribute("targets", "#"+targets+id+" #"+ fields[i+1]);
+						id++;
+						writer.writeCharacters("\n");
+					}
+				//}
+			}
+			writer.writeEndElement(); // linkGrp
+		}
+	}
+
+	/**
+	 * Write tail.
+	 */
+	private void writeTail() {
+		writer.writeEndElement(); // div
+		writer.writeEndElement(); // body
+		writer.writeEndElement(); // text
+		writer.writeEndElement(); // TEI
+	}
+
+	/**
+	 * Sets the annotation types.
+	 *
+	 * @param types the types
+	 * @param typesDesc the types desc
+	 * @param typesURI the types uri
+	 * @param typesWEB the types web
+	 * @param idform the idform
+	 */
+	public void setAnnotationTypes(def types,def typesDesc,def typesURI,def typesWEB, String idform) {
+		this.types = types;
+		this.typesDesc = typesDesc;
+		this.typesURI = typesURI;
+		this.typesWEB = typesWEB;
+		this.idform = idform;
+	}
+
+	/**
+	 * Sets the resp.
+	 *
+	 * @param respId the resp id
+	 * @param respChat the resp chat
+	 * @param respDate the resp date
+	 * @param respPerson the resp person
+	 * @param respWhen the resp when
+	 */
+	public void setResp(respId, respChat,respDate, respPerson,respWhen) {
+		this.respId = respId;
+		this.respChat = respChat;
+		this.respDate = respDate
+		this.respPerson = respPerson;
+		this.respWhen = respWhen;
+	}
+
+	/**
+	 * Sets the target.
+	 *
+	 * @param target the target
+	 * @param reportFile the report file
+	 */
+	public void setTarget(target, reportFile) {
+		this.target = target;
+		this.reportfile = reportFile;
+	}
+
+	/**
+	 * Sets the app.
+	 *
+	 * @param appIdent the app ident
+	 * @param appVersion the app version
+	 */
+	public void setApp(String appIdent, String appVersion) {
+		this.appIdent = appIdent;
+		this.appVersion = appVersion;
+	}
+
+	/**
+	 * Sets the infos.
+	 *
+	 * @param distributor the distributor
+	 * @param publiChat the publi chat
+	 * @param sourceChat the source chat
+	 */
+	public void setInfos(distributor,  publiChat, sourceChat) {
+		this.distributor = distributor;
+		this.publiChat = publiChat;
+		this.sourceChat = sourceChat;
+	}
+
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args) {
+
+		String rootDir = "~/xml/rgaqcj/";
+		new File(rootDir,"proj").mkdir();
+
+		//targeted file for annotations
+		String target = "roland.xml"
+		//contains txm:application/txm:commandLine
+		File reportFile = new File("~/xml/rgaqcj/tt1_REPORT.xml");
+
+		String respPerson ="slh";
+		String respId = "TT1";
+		String respDesc = "NLP annotation tool";
+		String respDate = "Tue Mar  11 1:02:55 Paris, Madrid 2010";
+		String respWhen="2010-03-11"
+
+		String appIdent = "TreeTagger";
+		String appVersion = "3.2";
+
+		String distributor = "BFM project - http://bfm.ens-lsh.fr";
+		String publiStmt = """<availability>
+			  <p>(c) 2010 Projet BFM - CNRS/ENS-LSH.
+			  <hi>Conditions d'utilisation</hi> : 
+			  Sous licence <ref target="http://creativecommons.org/licenses/by-sa/2.0/fr/">Creative Commons</ref>.
+			  </p>
+			</availability>""";
+
+		String sourceStmt = """<p>Born digital: TXM project - http://textometrie.org</p>
+			<p>Automatically generated on <date when=" """+respWhen+"""">"""+respDate+"""</date>
+			from <ref target="#"""+respId+"""">Tree Tagger</ref> applied on the text roland-tt.
+			</p>""";
+
+		def types = ["CATTEX2009"];
+		def typesTITLE = ["CATTEX2009"];
+		def typesDesc = ["CATTEX2009 POS description"]
+		def typesTAGSET = ["http://bfm.ens-lsh.fr/IMG/xml/cattex2009.xml"]
+		def typesWEB = ["http://bfm.ens-lsh.fr/article.php3?id_article=176"]
+		String idform ="w_fro_";
+
+		File ttfile = new File(rootDir+"/proj/","rol_rga.tt");
+		File posfile = new File(rootDir+"/pos/","rolandTT1-w-ana.xml");
+		String encoding ="UTF-8";
+		println("Process file : "+ttfile+" to : "+posfile );
+
+		def transfo = new CSV2W_ANA();
+		transfo.setAnnotationTypes( types, typesDesc, typesTAGSET, typesWEB, idform);
+		transfo.setResp(respId, respDesc,respDate, respPerson, respWhen);
+		transfo.setApp(appIdent, appVersion);
+		transfo.setTarget(target, reportFile);
+		transfo.setInfos(distributor,  publiStmt, sourceStmt);
+		transfo.process( ttfile, posfile, encoding );
+
+		//create annotation file for afrpar on roalnd.xml
+		String infile = rootDir+"/ttsrc/roland-learn.tt";
+		String modelfile =  rootDir+"/models/afr.par";
+		String outfile = rootDir+"/proj/afr_rol.tt";
+
+		println("proj "+modelfile+ " on " +infile +" >> "+outfile);
+
+		TreeTagger tt = new TreeTagger("~/Bureau/treetagger/bin/");
+		tt.settoken();
+		tt.setquiet();
+		tt.setsgml();
+		tt.seteostag("<s>");
+		tt.treetagger( modelfile, infile, outfile)
+
+		reportFile = new File("~/xml/rgaqcj/tt2_REPORT.xml");
+		respPerson ="slh";
+		respId = "TT2";
+		respDesc = "NLP annotation tool";
+		respDate = "Tue Mar  15 1:02:55 Paris, Madrid 2010";
+		respWhen = "2010-03-15"
+
+		types = ["AFRPOS"];
+		typesDesc = ["AFRPOS description"]
+		typesWEB = ["http://www.uni-stuttgart.de/lingrom/stein/forschung/resource.html"]
+		typesTAGSET = [""]
+		idform ="w_fro_";
+
+		ttfile = new File(rootDir+"/proj/","afr_rol.tt");
+		posfile = new File(rootDir+"/pos/","rolandTT2-w-ana.xml");
+		encoding ="UTF-8";
+		println("Process file : "+ttfile+" to : "+posfile );
+
+		transfo = new CSV2W_ANA();
+		transfo.setAnnotationTypes( types, typesDesc, typesTAGSET, typesWEB, idform);
+		transfo.setResp(respId, respDesc,respDate, respPerson,respWhen);
+		transfo.setTarget(target, reportFile);
+		transfo.setApp(appIdent, appVersion);
+		transfo.setInfos(distributor,  publiStmt, sourceStmt);
+		transfo.process( ttfile, posfile, encoding );
+	}
+}
\ No newline at end of file
Index: tmp/org.txm.core/.settings/org.eclipse.jdt.groovy.core.prefs
===================================================================
--- tmp/org.txm.core/.settings/org.eclipse.jdt.groovy.core.prefs	(revision 880)
+++ tmp/org.txm.core/.settings/org.eclipse.jdt.groovy.core.prefs	(revision 881)
@@ -1,3 +1,3 @@
 eclipse.preferences.version=1
-groovy.compiler.level=23
+groovy.compiler.level=-1
 groovy.script.filters=scripts/**/*.groovy,y,src/main/resources/**/*.groovy,y,src/test/resources/**/*.groovy,y
Index: tmp/org.txm.partition.feature/feature.xml
===================================================================
--- tmp/org.txm.partition.feature/feature.xml	(revision 880)
+++ tmp/org.txm.partition.feature/feature.xml	(revision 881)
@@ -17,19 +17,10 @@
    </license>
 
    <requires>
-      <import plugin="org.txm.utils" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.osgi" version="3.10.2" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.core.runtime" version="3.10.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.chartsengine.core"/>
-      <import plugin="org.txm.searchengine.cqp.core" version="1.1.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.core" version="0.7.0" match="greaterOrEqual"/>
       <import plugin="org.txm.chartsengine.jfreechart.core" version="1.0.0" match="greaterOrEqual"/>
       <import plugin="org.txm.chartsengine.r.core" version="1.0.0" match="greaterOrEqual"/>
       <import plugin="org.txm.lexicaltable.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.ui"/>
       <import plugin="org.txm.chartsengine.rcp"/>
-      <import plugin="org.txm.rcp" version="0.7.8" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.core.expressions" version="3.4.600" match="greaterOrEqual"/>
    </requires>
 
    <plugin
Index: tmp/org.txm.referencer.rcp/src/org/txm/referencer/rcp/editors/ReferencerEditor.java
===================================================================
--- tmp/org.txm.referencer.rcp/src/org/txm/referencer/rcp/editors/ReferencerEditor.java	(revision 880)
+++ tmp/org.txm.referencer.rcp/src/org/txm/referencer/rcp/editors/ReferencerEditor.java	(revision 881)
@@ -34,8 +34,6 @@
 import org.eclipse.jface.viewers.TableViewer;
 import org.eclipse.osgi.util.NLS;
 import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.graphics.Font;
@@ -43,7 +41,6 @@
 import org.eclipse.swt.graphics.Point;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Label;
@@ -60,17 +57,14 @@
 import org.txm.rcp.swt.widget.NavigationWidget;
 import org.txm.rcp.swt.widget.PropertiesSelector;
 import org.txm.rcp.swt.widget.QueryWidget;
-import org.txm.rcp.views.QueriesView;
 import org.txm.referencer.core.functions.Referencer;
 import org.txm.referencer.core.functions.Referencer.Line;
 import org.txm.referencer.core.preferences.ReferencerPreferences;
-import org.txm.referencer.rcp.handlers.___ReferencerToConc;
 import org.txm.referencer.rcp.messages.ReferencerUIMessages;
 import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
 import org.txm.searchengine.cqp.corpus.Corpus;
 import org.txm.searchengine.cqp.corpus.Property;
 import org.txm.searchengine.cqp.corpus.StructuralUnitProperty;
-import org.txm.statsengine.r.rcp.views.RVariablesView;
 
 /**
  * The Class ReferencerEditor display&update a Referencer TXMResult
@@ -329,10 +323,6 @@
 
 		fillDisplayArea(0, lineperpage);
 		
-		// FIXME: should be moved and mutualized
-		QueriesView.refresh();
-		RVariablesView.refresh();
-
 		viewer.getTable().setFocus();
 		System.out.println(NLS.bind(TXMUIMessages.CreatePartition_5, referencer.getNLines(), referencer.getV()));
 	}
Index: tmp/org.txm.referencer.rcp/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.referencer.rcp/META-INF/MANIFEST.MF	(revision 880)
+++ tmp/org.txm.referencer.rcp/META-INF/MANIFEST.MF	(revision 881)
@@ -1,17 +1,7 @@
 Manifest-Version: 1.0
-Require-Bundle: org.txm.utils;bundle-version="1.0.0";visibility:=reexport,
+Require-Bundle: org.txm.concordance.rcp;bundle-version="1.0.0";visibility:=reexport,
  org.txm.referencer.core;bundle-version="1.0.0";visibility:=reexport,
- org.txm.concordance.core;bundle-version="1.0.0";visibility:=reexport,
- org.txm.searchengine.cqp.core;bundle-version="1.1.0";visibility:=reexport,
- org.txm.concordance.rcp;bundle-version="1.0.0";visibility:=reexport,
- org.txm.statsengine.r.rcp;bundle-version="1.0.0";visibility:=reexport,
- org.eclipse.ui;visibility:=reexport,
- org.eclipse.core.runtime;visibility:=reexport,
- org.txm.core;bundle-version="0.7.0";visibility:=reexport,
- org.txm.rcp;bundle-version="0.7.8";visibility:=reexport,
- org.eclipse.core.expressions;bundle-version="3.4.600";visibility:=reexport,
- org.txm.searchengine.core;bundle-version="1.0.0";visibility:=reexport,
- org.txm.links.rcp;bundle-version="1.0.0"
+ org.txm.links.rcp;bundle-version="1.0.0";visibility:=reexport
 Export-Package: org.txm.referencer.rcp.adapters,
  org.txm.referencer.rcp.editors,
  org.txm.referencer.rcp.handlers,
Index: tmp/org.txm.concordance.core/.classpath
===================================================================
--- tmp/org.txm.concordance.core/.classpath	(revision 880)
+++ tmp/org.txm.concordance.core/.classpath	(revision 881)
@@ -1,7 +1,15 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
+		<accessrules>
+			<accessrule kind="accessible" pattern="**"/>
+		</accessrules>
+	</classpathentry>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
+		<accessrules>
+			<accessrule kind="accessible" pattern="**"/>
+		</accessrules>
+	</classpathentry>
 	<classpathentry kind="src" path="src"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
Index: tmp/org.txm.concordance.core/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.concordance.core/META-INF/MANIFEST.MF	(revision 880)
+++ tmp/org.txm.concordance.core/META-INF/MANIFEST.MF	(revision 881)
@@ -1,11 +1,6 @@
 Manifest-Version: 1.0
-Require-Bundle: org.txm.utils;bundle-version="1.0.0";visibility:=reexp
- ort,org.txm.searchengine.cqp.core;bundle-version="1.1.0";visibility:=
- reexport,org.eclipse.osgi;bundle-version="3.10.2";visibility:=reexpor
- t,org.eclipse.core.runtime;bundle-version="3.10.0";visibility:=reexpo
- rt,org.txm.core;visibility:=reexport,org.txm.searchengine.core;bundle
- -version="1.0.0";visibility:=reexport,org.txm.statsengine.r.core;bund
- le-version="1.0.0";visibility:=reexport
+Require-Bundle: org.txm.searchengine.cqp.core;bundle-version="1.1.0";visibility:=reexport,
+ org.txm.statsengine.r.core;bundle-version="1.0.0";visibility:=reexport
 Export-Package: org.txm.concordance.core,
  org.txm.concordance.core.functions,
  org.txm.concordance.core.functions.comparators,
Index: tmp/org.txm.referencer.core/.classpath
===================================================================
--- tmp/org.txm.referencer.core/.classpath	(revision 880)
+++ tmp/org.txm.referencer.core/.classpath	(revision 881)
@@ -1,7 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
+		<accessrules>
+			<accessrule kind="accessible" pattern="**"/>
+		</accessrules>
+	</classpathentry>
 	<classpathentry kind="src" path="src"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
Index: tmp/org.txm.referencer.core/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.referencer.core/META-INF/MANIFEST.MF	(revision 880)
+++ tmp/org.txm.referencer.core/META-INF/MANIFEST.MF	(revision 881)
@@ -1,9 +1,6 @@
 Manifest-Version: 1.0
-Require-Bundle: org.txm.utils;bundle-version="1.0.0";visibility:=reexp
- ort,org.txm.statsengine.r.core;bundle-version="1.0.0";visibility:=ree
- xport,org.txm.core;bundle-version="0.7.0";visibility:=reexport,org.tx
- m.searchengine.core;bundle-version="1.0.0";visibility:=reexport,org.t
- xm.searchengine.cqp.core;bundle-version="1.1.0";visibility:=reexport
+Require-Bundle: org.txm.statsengine.r.core;bundle-version="1.0.0";visibility:=reexport,
+ org.txm.searchengine.cqp.core;bundle-version="1.1.0";visibility:=reexport
 Export-Package: org.txm.referencer.core,
  org.txm.referencer.core.functions,
  org.txm.referencer.core.messages,
Index: tmp/org.txm.searchengine.cqp.feature/feature.xml
===================================================================
--- tmp/org.txm.searchengine.cqp.feature/feature.xml	(revision 880)
+++ tmp/org.txm.searchengine.cqp.feature/feature.xml	(revision 881)
@@ -19,17 +19,9 @@
    <requires>
       <import plugin="org.txm.utils" version="1.0.0" match="greaterOrEqual"/>
       <import plugin="org.txm.core"/>
-      <import plugin="org.eclipse.ui"/>
-      <import plugin="org.eclipse.core.runtime"/>
-      <import plugin="org.txm.core" version="0.7.0" match="greaterOrEqual"/>
       <import plugin="org.txm.searchengine.core" version="1.0.0" match="greaterOrEqual"/>
       <import plugin="org.txm.libs.cqp" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.searchengine.cqp.core" version="1.1.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.core" version="0.8.0" match="greaterOrEqual"/>
       <import plugin="org.txm.rcp" version="0.8.0" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.core.commands" version="3.6.100" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.ui.workbench" version="3.106.2" match="greaterOrEqual"/>
-      <import plugin="org.txm.libs.cqp" version="1.0.0.qualifier" match="greaterOrEqual"/>
    </requires>
 
    <plugin
@@ -75,7 +67,6 @@
          download-size="0"
          install-size="0"
          version="0.0.0"
-         fragment="true"
-         unpack="false"/>
+         fragment="true"/>
 
 </feature>
Index: tmp/org.txm.partition.rcp/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.partition.rcp/META-INF/MANIFEST.MF	(revision 880)
+++ tmp/org.txm.partition.rcp/META-INF/MANIFEST.MF	(revision 881)
@@ -1,14 +1,6 @@
 Manifest-Version: 1.0
-Require-Bundle: org.txm.chartsengine.core;visibility:=reexport,org.txm
- .utils;bundle-version="1.0.0";visibility:=reexport,org.eclipse.osgi;b
- undle-version="3.10.2";visibility:=reexport,org.eclipse.core.runtime;
- bundle-version="3.10.0";visibility:=reexport,org.eclipse.ui;visibilit
- y:=reexport,org.txm.core;bundle-version="0.7.0";visibility:=reexport,
- org.txm.searchengine.cqp.core;bundle-version="1.1.0";visibility:=reex
- port,org.txm.chartsengine.rcp;visibility:=reexport,org.txm.partition.
- core;visibility:=reexport,org.txm.rcp;bundle-version="0.7.8";visibili
- ty:=reexport,org.eclipse.core.expressions;bundle-version="3.4.600";vi
- sibility:=reexport
+Require-Bundle: org.txm.chartsengine.rcp;visibility:=reexport,
+ org.txm.partition.core;bundle-version="1.0.0";visibility:=reexport
 Export-Package: org.txm.partition.rcp.adapters,
  org.txm.partition.rcp.editors,
  org.txm.partition.rcp.handlers,
Index: tmp/org.txm.internalview.core/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.internalview.core/META-INF/MANIFEST.MF	(revision 880)
+++ tmp/org.txm.internalview.core/META-INF/MANIFEST.MF	(revision 881)
@@ -1,6 +1,5 @@
 Manifest-Version: 1.0
-Require-Bundle: org.txm.core;bundle-version="0.8.0";visibility:=reexpo
- rt,org.txm.searchengine.cqp.core;visibility:=reexport
+Require-Bundle: org.txm.searchengine.cqp.core;visibility:=reexport
 Export-Package: org.txm.internalview.core.functions,org.txm.internalvi
  ew.core.messages,org.txm.internalview.core.preferences
 Bundle-ActivationPolicy: lazy
Index: tmp/org.txm.searchengine.cqp.rcp/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.searchengine.cqp.rcp/META-INF/MANIFEST.MF	(revision 880)
+++ tmp/org.txm.searchengine.cqp.rcp/META-INF/MANIFEST.MF	(revision 881)
@@ -1,11 +1,6 @@
 Manifest-Version: 1.0
-Require-Bundle: org.txm.searchengine.core;bundle-version="1.0.0";visib
- ility:=reexport,org.txm.searchengine.cqp.core;bundle-version="1.1.0";
- visibility:=reexport,org.txm.core;bundle-version="0.8.0";visibility:=
- reexport,org.txm.rcp;bundle-version="0.8.0";visibility:=reexport,org.
- eclipse.core.commands;bundle-version="3.6.100";visibility:=reexport,o
- rg.eclipse.ui.workbench;bundle-version="3.106.2";visibility:=reexport
- ,org.eclipse.ui;visibility:=reexport
+Require-Bundle: org.txm.rcp;bundle-version="0.8.0";visibility:=reexport,
+ org.txm.searchengine.cqp.core;bundle-version="1.1.0";visibility:=reexport
 Export-Package: org.txm.searchengine.cqp.rcp.adapters,org.txm.searchen
  gine.cqp.rcp.handlers.base,org.txm.searchengine.cqp.rcp.messages,org.
  txm.searchengine.cqp.rcp.preferences
Index: tmp/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/handlers/base/ComputeIntersection.java
===================================================================
--- tmp/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/handlers/base/ComputeIntersection.java	(revision 0)
+++ tmp/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/handlers/base/ComputeIntersection.java	(revision 881)
@@ -0,0 +1,101 @@
+package org.txm.searchengine.cqp.rcp.handlers.base;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandlerListener;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.txm.Toolbox;
+import org.txm.searchengine.cqp.AbstractCqiClient;
+import org.txm.searchengine.cqp.CQPSearchEngine;
+import org.txm.searchengine.cqp.corpus.Corpus;
+import org.txm.searchengine.cqp.corpus.CqpObject;
+import org.txm.searchengine.cqp.corpus.MainCorpus;
+import org.txm.searchengine.cqp.corpus.Subcorpus;
+
+public class ComputeIntersection extends AbstractHandler {
+
+	@Override
+	public void addHandlerListener(IHandlerListener handlerListener) {
+		super.addHandlerListener(handlerListener);
+	}
+
+	@Override
+	public void dispose() {
+		super.dispose();
+	}
+
+
+	@Override
+	public Object execute(ExecutionEvent event) throws ExecutionException {
+		ISelection isel = HandlerUtil.getCurrentSelection(event);
+		if (!(isel instanceof IStructuredSelection)) return null;
+		IStructuredSelection selection = (IStructuredSelection) isel;
+		List list = selection.toList();
+		ArrayList<Subcorpus> subcorpora = new ArrayList<Subcorpus>();
+		for (Object o : list) if (o instanceof Subcorpus) subcorpora.add((Subcorpus) o);
+
+		if (subcorpora.size() != 2) {
+			System.out.println("Error: selection size != 2 : "+subcorpora.size());
+			return null;
+		}
+
+		HashSet<MainCorpus> set = new HashSet<MainCorpus>();
+		for (Subcorpus s : subcorpora) set.add(s.getMainCorpus());
+		if (set.size() > 1) {
+			System.out.println("Error: selected subcorpus have different main corpus: "+set);
+			return null;
+		}
+
+		MainCorpus ancestor = subcorpora.get(0).getMainCorpus();
+		String id1 = subcorpora.get(0).getQualifiedCqpId();
+		String id2 = subcorpora.get(1).getQualifiedCqpId();
+		String cqpid = CqpObject.subcorpusNamePrefix + Corpus.getNextSubcorpusCounter();
+		String command = "inter";
+		AbstractCqiClient CQI = CQPSearchEngine.getCqiClient();
+
+		//TODO: finish the command
+		
+//		String query = cqpid+"="+command+" "+id1+" "+id2+";";
+//		try {
+//			CQI.query(query)
+//		} catch (Exception e) {
+//			println "Error: "+CQI.getLastError()+". Please restart TXM."
+//			return;
+//		}
+//
+//		Subcorpus subcorpus = new Subcorpus(cqpid, name, ancestor, new Query("$command $id1 $id2;"));
+//
+//		println "$subcorpus stored in $ancestor"
+//
+//		monitor.syncExec(new Runnable() {
+//			public void run() {
+//				CorporaView.refresh();
+//				CorporaView.expand(subcorpus.getParent());
+//			}
+//		});
+
+		return null;
+	}
+
+	@Override
+	public boolean isEnabled() {
+		return super.isEnabled();
+	}
+
+	@Override
+	public boolean isHandled() {
+		return super.isHandled();
+	}
+
+	@Override
+	public void removeHandlerListener(IHandlerListener handlerListener) {
+		super.removeHandlerListener(handlerListener);
+	}
+}

Property changes on: tmp/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/handlers/base/ComputeIntersection.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.internalview.feature/feature.xml
===================================================================
--- tmp/org.txm.internalview.feature/feature.xml	(revision 880)
+++ tmp/org.txm.internalview.feature/feature.xml	(revision 881)
@@ -17,12 +17,9 @@
    </license>
 
    <requires>
-      <import plugin="org.txm.core" version="0.8.0" match="greaterOrEqual"/>
       <import plugin="org.txm.searchengine.cqp.core"/>
       <import plugin="org.txm.internalview.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.rcp" version="0.8.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.concordance.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.osgi"/>
+      <import plugin="org.txm.links.rcp" version="1.0.0" match="greaterOrEqual"/>
    </requires>
 
    <plugin
Index: tmp/org.txm.links.rcp/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.links.rcp/META-INF/MANIFEST.MF	(revision 880)
+++ tmp/org.txm.links.rcp/META-INF/MANIFEST.MF	(revision 881)
@@ -1,6 +1,4 @@
 Manifest-Version: 1.0
-Require-Bundle: org.eclipse.ui;bundle-version="3.106.1";visibility:=reexport,
- org.txm.rcp;bundle-version="0.8.0"
 Export-Package: org.txm,
  org.txm.links.rcp.handlers
 Bundle-Vendor: Textometrie.org
@@ -9,4 +7,6 @@
 Bundle-ManifestVersion: 2
 Bundle-SymbolicName: org.txm.links.rcp;singleton:=true
 Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Require-Bundle: org.txm.rcp;bundle-version="0.8.0";visibility:=reexport,
+ org.txm.searchengine.cqp.core
 
Index: tmp/org.txm.links.rcp/src/org/txm/links/rcp/handlers/SendSelectionToQueryable.java
===================================================================
--- tmp/org.txm.links.rcp/src/org/txm/links/rcp/handlers/SendSelectionToQueryable.java	(revision 880)
+++ tmp/org.txm.links.rcp/src/org/txm/links/rcp/handlers/SendSelectionToQueryable.java	(revision 881)
@@ -63,8 +63,6 @@
 	public String createQueries(ExecutionEvent event, IStructuredSelection selection) {
 		return this.createQuery(event, selection);
 	}
-
-
 	
 	@Override
 	public Object execute(ExecutionEvent event) throws ExecutionException {
Index: tmp/org.txm.links.rcp/src/org/txm/links/rcp/handlers/SendSelectionToMatchable.java
===================================================================
--- tmp/org.txm.links.rcp/src/org/txm/links/rcp/handlers/SendSelectionToMatchable.java	(revision 0)
+++ tmp/org.txm.links.rcp/src/org/txm/links/rcp/handlers/SendSelectionToMatchable.java	(revision 881)
@@ -0,0 +1,87 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 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:$
+// $LastChangedRevision:$
+// $LastChangedBy:$ 
+//
+package org.txm.links.rcp.handlers;
+
+import java.util.List;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.txm.core.preferences.TXMPreferences;
+import org.txm.core.results.TXMResult;
+import org.txm.rcp.handlers.BaseAbstractHandler;
+import org.txm.searchengine.cqp.corpus.query.Match;
+import org.txm.utils.logger.Log;
+
+/**
+ * Base command to send a selection to a command that needs a query to compute the new result.
+ * 
+ * @author mdecorde
+ * @author sjacquot
+ * 
+ */
+public abstract class SendSelectionToMatchable extends BaseAbstractHandler {
+
+	
+
+	/**
+	 * Creates the queries.
+	 * This method is essentially dedicated to be overridden, if needed.
+	 * @param selection
+	 * @return
+	 */
+	public abstract List<Match> createMatches(ExecutionEvent event, IStructuredSelection selection);
+
+	@Override
+	public Object execute(ExecutionEvent event) throws ExecutionException {
+		
+		IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
+		if (selection != null) {
+			
+			List<Match> matches = this.createMatches(event, selection);
+			
+			if(matches.isEmpty()) {
+				Log.severe("No matches was set, command canceled.");
+				return null;
+			}
+			
+			// create local result node, store in some parameters and call the linked command
+			String uuid = TXMResult.createUUID();
+			TXMPreferences.put(uuid, TXMPreferences.PARENT_UUID, this.getResultParent(event).getUUID());
+			TXMPreferences.put(uuid, TXMPreferences.MATCHES, matches.toString());
+			
+			BaseAbstractHandler.executeSendToCommand(event.getCommand().getId(), uuid);
+		}
+		else	{
+			this.logCanNotCompute(selection);
+		}
+		return null;
+	}
+
+}

Property changes on: tmp/org.txm.links.rcp/src/org/txm/links/rcp/handlers/SendSelectionToMatchable.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.statsengine.r.feature/feature.xml
===================================================================
--- tmp/org.txm.statsengine.r.feature/feature.xml	(revision 880)
+++ tmp/org.txm.statsengine.r.feature/feature.xml	(revision 881)
@@ -18,31 +18,9 @@
 
    <requires>
       <import plugin="org.txm.statsengine.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.core" version="0.7.0" match="greaterOrEqual"/>
       <import plugin="org.txm.libs.rserve"/>
-      <import plugin="org.txm.utils" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.osgi"/>
-      <import plugin="org.eclipse.core.runtime"/>
-      <import plugin="org.txm.libs.colt" version="1.0.0" match="greaterOrEqual"/>
       <import plugin="org.txm.statsengine.r.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.ui" version="3.106.1" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.osgi" version="3.10.2" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.jface.text" version="3.9.2" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.core.runtime" version="3.10.0" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.ui.console" version="3.5.300" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.ui.ide" version="3.10.2" match="greaterOrEqual"/>
-      <import plugin="org.txm.index.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.concordance.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.lexicaltable.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.ca.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.specificities.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.progression.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.ahc.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.cooccurrence.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.searchengine.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.referencer.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.searchengine.cqp.core" version="1.1.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.rcp" version="0.7.8" match="greaterOrEqual"/>
+      <import plugin="org.txm.rcp" version="0.8.0" match="greaterOrEqual"/>
    </requires>
 
    <plugin
Index: tmp/org.txm.internalview.rcp/src/org/txm/internalview/rcp/handlers/BackToInternalView.java
===================================================================
--- tmp/org.txm.internalview.rcp/src/org/txm/internalview/rcp/handlers/BackToInternalView.java	(revision 0)
+++ tmp/org.txm.internalview.rcp/src/org/txm/internalview/rcp/handlers/BackToInternalView.java	(revision 881)
@@ -0,0 +1,44 @@
+package org.txm.internalview.rcp.handlers;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.e4.ui.workbench.modeling.EModelService;
+import org.eclipse.ui.IWorkbenchPage;
+import org.txm.core.preferences.TBXPreferences;
+import org.txm.core.results.TXMResult;
+import org.txm.internalview.core.functions.InternalView;
+import org.txm.internalview.rcp.editors.InternalViewEditor;
+import org.txm.rcp.TXMWindows;
+import org.txm.rcp.editors.TXMEditor;
+import org.txm.rcp.editors.TXMResultEditorInput;
+import org.txm.rcp.utils.SWTEditorsUtils;
+import org.txm.searchengine.cqp.corpus.Corpus;
+import org.txm.searchengine.cqp.corpus.StructuralUnitProperty;
+import org.txm.searchengine.cqp.corpus.WordProperty;
+import org.txm.searchengine.cqp.corpus.query.Match;
+import org.txm.utils.logger.Log;
+
+public class BackToInternalView {
+
+	public void doit(TXMEditor<? extends TXMResult> sourceEditor, Corpus corpus, Match match, List<WordProperty> props) {
+		// Last resort edition
+		try {
+			InternalView iview = new InternalView(corpus);
+			iview.setParameters(props, 
+					corpus.getStructuralUnit(TBXPreferences.DEFAULT_STRUCTURAL_UNIT),
+					new ArrayList<StructuralUnitProperty>(), null);
+
+			TXMResultEditorInput<InternalView> editorInput = new TXMResultEditorInput<InternalView>(iview);
+
+			IWorkbenchPage page = TXMWindows.getActiveWindow().getActivePage();
+
+			InternalViewEditor editor = (InternalViewEditor)page.openEditor(editorInput,InternalViewEditor.class.getName()); //$NON-NLS-1$
+			editor.backToText(match);
+			SWTEditorsUtils.addEditor(sourceEditor, editor, EModelService.ABOVE);
+		} catch (Exception e) {
+			System.err.println("Error: could not open InternalView editor: "+ e);
+			Log.printStackTrace(e);
+		}
+	}
+}

Property changes on: tmp/org.txm.internalview.rcp/src/org/txm/internalview/rcp/handlers/BackToInternalView.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.internalview.rcp/src/org/txm/internalview/rcp/editors/InternalViewEditor.java
===================================================================
--- tmp/org.txm.internalview.rcp/src/org/txm/internalview/rcp/editors/InternalViewEditor.java	(revision 880)
+++ tmp/org.txm.internalview.rcp/src/org/txm/internalview/rcp/editors/InternalViewEditor.java	(revision 881)
@@ -20,7 +20,6 @@
 import org.eclipse.swt.widgets.Table;
 import org.eclipse.swt.widgets.TableColumn;
 import org.eclipse.swt.widgets.TableItem;
-import org.txm.concordance.core.functions.Line;
 import org.txm.core.results.Parameter;
 import org.txm.internalview.core.functions.InternalView;
 import org.txm.internalview.core.preferences.InternalViewPreferences;
@@ -349,8 +348,8 @@
 //		return null;
 //	}
 
-	public boolean backToText(Line line) {
-		Match m = line.getMatch();
+	public boolean backToText(Match m) {
+//		Match m = line.getMatch();
 		internalView.getCurrentPage();
 		int[] cpos= {m.getStart()};
 		int[] n;
@@ -363,7 +362,7 @@
 			n = CQPSearchEngine.getCqiClient().cpos2Struc(sup.getQualifiedName(), cpos);
 			return goToPage(n[0]);
 		} catch (Exception e) {
-			System.out.println("Error while internal view go back to " + line);
+			System.out.println("Error while internal view go back to " + m);
 			Log.printStackTrace(e);
 		} 
 		return false;
Index: tmp/org.txm.internalview.rcp/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.internalview.rcp/META-INF/MANIFEST.MF	(revision 880)
+++ tmp/org.txm.internalview.rcp/META-INF/MANIFEST.MF	(revision 881)
@@ -1,9 +1,6 @@
 Manifest-Version: 1.0
 Require-Bundle: org.txm.internalview.core;bundle-version="1.0.0";visibility:=reexport,
- org.txm.rcp;bundle-version="0.8.0";visibility:=reexport,
- org.txm.concordance.core;bundle-version="1.0.0";visibility:=reexport,
- org.eclipse.osgi;visibility:=reexport,
- org.txm.links.rcp;bundle-version="1.0.0"
+ org.txm.links.rcp;bundle-version="1.0.0";visibility:=reexport
 Export-Package: org.txm.internalview.rcp.adapters,org.txm.internalview
  .rcp.editors,org.txm.internalview.rcp.handlers,org.txm.internalview.r
  cp.messages
Index: tmp/org.txm.progression.rcp/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.progression.rcp/META-INF/MANIFEST.MF	(revision 880)
+++ tmp/org.txm.progression.rcp/META-INF/MANIFEST.MF	(revision 881)
@@ -1,22 +1,8 @@
 Manifest-Version: 1.0
-Require-Bundle: org.txm.utils;visibility:=reexport,
- org.eclipse.osgi;bundle-version="3.10.2";visibility:=reexport,
- org.eclipse.core.runtime;bundle-version="3.10.0";visibility:=reexport,
- org.eclipse.ui;bundle-version="3.106.1";visibility:=reexport,
- org.eclipse.e4.ui.workbench;bundle-version="1.2.2";visibility:=reexport,
- org.txm.concordance.rcp;visibility:=reexport,
- org.txm.edition.rcp;visibility:=reexport,
- org.txm.searchengine.cqp.core;bundle-version="1.1.0";visibility:=reexport,
+Require-Bundle: org.txm.chartsengine.rcp;bundle-version="1.0.0";visibility:=reexport,
  org.txm.progression.core;bundle-version="1.0.0";visibility:=reexport,
- org.txm.lexicaltable.rcp;bundle-version="1.0.0";visibility:=reexport,
- org.txm.chartsengine.r.core;bundle-version="1.0.0";visibility:=reexport,
- org.txm.chartsengine.rcp;bundle-version="1.0.0";visibility:=reexport,
- org.eclipse.ui.workbench;visibility:=reexport,
- org.eclipse.swt;visibility:=reexport,
- org.txm.core;bundle-version="0.7.0";visibility:=reexport,
- org.eclipse.core.expressions;bundle-version="3.4.600";visibility:=reexport,
- org.txm.rcp;visibility:=reexport,
- org.txm.links.rcp;bundle-version="1.0.0"
+ org.txm.concordance.rcp;bundle-version="1.0.0";visibility:=reexport,
+ org.txm.edition.rcp;bundle-version="1.0.0";visibility:=reexport
 Export-Package: org.txm.progression.rcp.adapters,org.txm.progression.r
  cp.chartsengine.events,org.txm.progression.rcp.editors,org.txm.progre
  ssion.rcp.handlers,org.txm.progression.rcp.messages,org.txm.progressi
Index: tmp/org.txm.partition.core/.classpath
===================================================================
--- tmp/org.txm.partition.core/.classpath	(revision 880)
+++ tmp/org.txm.partition.core/.classpath	(revision 881)
@@ -1,7 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
+		<accessrules>
+			<accessrule kind="accessible" pattern="**"/>
+		</accessrules>
+	</classpathentry>
 	<classpathentry kind="src" path="src"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
Index: tmp/org.txm.partition.core/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.partition.core/META-INF/MANIFEST.MF	(revision 880)
+++ tmp/org.txm.partition.core/META-INF/MANIFEST.MF	(revision 881)
@@ -1,13 +1,7 @@
 Manifest-Version: 1.0
-Require-Bundle: org.txm.utils;bundle-version="1.0.0";visibility:=reexp
- ort,org.eclipse.osgi;bundle-version="3.10.2";visibility:=reexport,org
- .eclipse.core.runtime;bundle-version="3.10.0";visibility:=reexport,or
- g.txm.chartsengine.core;visibility:=reexport,org.txm.searchengine.cqp
- .core;bundle-version="1.1.0";visibility:=reexport,org.txm.core;bundle
- -version="0.7.0";visibility:=reexport,org.txm.chartsengine.jfreechart
- .core;bundle-version="1.0.0";visibility:=reexport,org.txm.chartsengin
- e.r.core;bundle-version="1.0.0";visibility:=reexport,org.txm.lexicalt
- able.core;bundle-version="1.0.0";visibility:=reexport
+Require-Bundle: org.txm.chartsengine.jfreechart.core;bundle-version="1.0.0";visibility:=reexport,
+ org.txm.chartsengine.r.core;bundle-version="1.0.0";visibility:=reexport,
+ org.txm.lexicaltable.core;bundle-version="1.0.0";visibility:=reexport
 Export-Package: org.txm.partition.core.chartsengine.base,org.txm.parti
  tion.core.chartsengine.jfreechart,org.txm.partition.core.chartsengine
  .r,org.txm.partition.core.functions,org.txm.partition.core.messages,o
Index: tmp/org.txm.concordance.rcp/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.concordance.rcp/META-INF/MANIFEST.MF	(revision 880)
+++ tmp/org.txm.concordance.rcp/META-INF/MANIFEST.MF	(revision 881)
@@ -1,17 +1,6 @@
 Manifest-Version: 1.0
-Require-Bundle: org.txm.searchengine.core;bundle-version="1.0.0";visib
- ility:=reexport,org.eclipse.core.runtime;bundle-version="3.10.0";visi
- bility:=reexport,org.eclipse.ui;bundle-version="3.106.1";visibility:=
- reexport,org.txm.cooccurrence.core;bundle-version="1.0.0";visibility:
- =reexport,org.txm.cooccurrence.rcp;bundle-version="1.0.0";visibility:
- =reexport,org.txm.searchengine.cqp.core;bundle-version="1.1.0";visibi
- lity:=reexport,org.eclipse.e4.ui.workbench;bundle-version="1.2.2";vis
- ibility:=reexport,org.txm.concordance.core;visibility:=reexport,org.t
- xm.utils;bundle-version="1.0.0";visibility:=reexport,org.txm.core;vis
- ibility:=reexport,org.txm.rcp;visibility:=reexport,org.eclipse.core.e
- xpressions;bundle-version="3.4.600";visibility:=reexport,org.txm.inte
- rnalview.core;bundle-version="1.0.0";visibility:=reexport,org.txm.int
- ernalview.rcp;bundle-version="1.0.0";visibility:=reexport
+Require-Bundle: org.txm.rcp;bundle-version="0.8.0";visibility:=reexport,
+ org.txm.concordance.core;bundle-version="1.0.0";visibility:=reexport
 Export-Package: org.txm.concordance.rcp.actions,org.txm.concordance.rc
  p.adapters,org.txm.concordance.rcp.editors,org.txm.concordance.rcp.ha
  ndlers,org.txm.concordance.rcp.messages,org.txm.concordance.rcp.prefe
Index: tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/editors/ConcordanceEditor.java
===================================================================
--- tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/editors/ConcordanceEditor.java	(revision 880)
+++ tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/editors/ConcordanceEditor.java	(revision 881)
@@ -111,13 +111,10 @@
 import org.txm.concordance.rcp.handlers.DeleteLines;
 import org.txm.concordance.rcp.messages.ConcordanceUIMessages;
 import org.txm.concordance.rcp.widgets.ComplexSortSelector;
-import org.txm.cooccurrence.rcp.messages.CooccurrenceUIMessages;
 import org.txm.core.preferences.TBXPreferences;
 import org.txm.core.preferences.TXMPreferences;
 import org.txm.core.results.Parameter;
 import org.txm.core.results.TXMResult;
-import org.txm.internalview.core.functions.InternalView;
-import org.txm.internalview.rcp.editors.InternalViewEditor;
 import org.txm.objects.Page;
 import org.txm.rcp.IImageKeys;
 import org.txm.rcp.JobsTimer;
@@ -704,7 +701,7 @@
 			concordance.resetLines();
 
 			try {
-				Log.info(NLS.bind(CooccurrenceUIMessages.CooccurrencesEditor_0, currentComparator.getName()));
+				Log.info("Sorting with "+currentComparator.getName());
 				if (currentComparator instanceof CompositeComparator)
 					Log.info(((CompositeComparator) currentComparator).getComparators().toString());
 				JobHandler jobhandler = new JobHandler("Sorting...") { //$NON-NLS-1$
@@ -1899,26 +1896,6 @@
 			e1.printStackTrace();
 		}
 
-		// Last resort edition
-		try {
-			InternalView iview = new InternalView(concordance.getCorpus());
-			iview.setParameters(concordance.getKeywordAnalysisProperties(), 
-					concordance.getCorpus().getStructuralUnit(TBXPreferences.DEFAULT_STRUCTURAL_UNIT),
-					new ArrayList<StructuralUnitProperty>(), null);
-
-			TXMResultEditorInput editorInput = new TXMResultEditorInput(iview);
-
-			IWorkbenchPage page = TXMWindows.getActiveWindow().getActivePage();
-
-			StatusLine.setMessage(ConcordanceUIMessages.ComputeReferencer_0);
-			InternalViewEditor editor = (InternalViewEditor)page.openEditor(editorInput,InternalViewEditor.class.getName()); //$NON-NLS-1$
-			editor.backToText(line);
-			SWTEditorsUtils.addEditor(this, editor, EModelService.ABOVE);
-		} catch (Exception e) {
-			System.err.println("Error: could not open InternalView editor: "+ e);
-			Log.printStackTrace(e);
-		}
-
 		return false;
 
 		//		try {
Index: tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/RStatsEngine.java
===================================================================
--- tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/RStatsEngine.java	(revision 880)
+++ tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/RStatsEngine.java	(revision 881)
@@ -192,7 +192,7 @@
 
 
 	@Override
-	public boolean getState() {
+	public boolean isRunning() {
 		return started;
 	}
 
Index: tmp/org.txm.statsengine.r.core/.classpath
===================================================================
--- tmp/org.txm.statsengine.r.core/.classpath	(revision 880)
+++ tmp/org.txm.statsengine.r.core/.classpath	(revision 881)
@@ -1,7 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
+		<accessrules>
+			<accessrule kind="accessible" pattern="**"/>
+		</accessrules>
+	</classpathentry>
 	<classpathentry kind="src" path="src"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
Index: tmp/org.txm.statsengine.r.core/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.statsengine.r.core/META-INF/MANIFEST.MF	(revision 880)
+++ tmp/org.txm.statsengine.r.core/META-INF/MANIFEST.MF	(revision 881)
@@ -1,10 +1,6 @@
 Manifest-Version: 1.0
-Require-Bundle: org.txm.statsengine.core;bundle-version="1.0.0";visibi
- lity:=reexport,org.txm.core;bundle-version="0.7.0";visibility:=reexpo
- rt,org.txm.libs.rserve;bundle-version="0.0.0";visibility:=reexport,or
- g.txm.utils;bundle-version="1.0.0";visibility:=reexport,org.eclipse.o
- sgi;visibility:=reexport,org.eclipse.core.runtime;visibility:=reexpor
- t,org.txm.libs.colt;bundle-version="1.0.0";visibility:=reexport
+Require-Bundle: org.txm.statsengine.core;bundle-version="1.0.0";visibility:=reexport,
+ org.txm.libs.rserve;bundle-version="0.0.0";visibility:=reexport
 Export-Package: org.txm.statsengine.r.core,org.txm.statsengine.r.core.
  data,org.txm.statsengine.r.core.exceptions,org.txm.statsengine.r.core
  .messages,org.txm.statsengine.r.core.preferences,org.txm.statsengine.
Index: tmp/org.txm.rcp.feature/feature.xml
===================================================================
--- tmp/org.txm.rcp.feature/feature.xml	(revision 880)
+++ tmp/org.txm.rcp.feature/feature.xml	(revision 881)
@@ -78,16 +78,6 @@
          optional="true"/>
 
    <includes
-         id="org.eclipse.babel.nls_eclipse_fr"
-         version="0.0.0"
-         optional="true"/>
-
-   <includes
-         id="org.eclipse.babel.nls_eclipse_ru"
-         version="0.0.0"
-         optional="true"/>
-
-   <includes
          id="org.txm.statsengine.r.feature"
          version="0.0.0"
          optional="true"/>
@@ -189,7 +179,8 @@
 
    <includes
          id="org.txm.annotation.kr.feature"
-         version="0.0.0"/>
+         version="0.0.0"
+         optional="true"/>
 
    <requires>
       <import plugin="org.eclipse.core.runtime" version="3.10.0" match="greaterOrEqual"/>
@@ -207,59 +198,27 @@
       <import plugin="org.eclipse.ui.browser" version="3.2.300" match="greaterOrEqual"/>
       <import plugin="org.eclipse.ui.forms"/>
       <import plugin="org.eclipse.ui.editors"/>
-      <import plugin="org.eclipse.e4.ui.workbench.addons.swt" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.equinox.ds" version="1.4.100" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.equinox.event" version="1.3.0" match="greaterOrEqual"/>
       <import plugin="org.eclipse.equinox.p2.ui" version="2.3.0" match="greaterOrEqual"/>
       <import plugin="org.eclipse.equinox.p2.ui.sdk" version="1.0.300" match="greaterOrEqual"/>
       <import plugin="org.eclipse.equinox.p2.ui.sdk.scheduler" version="1.2.0" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.update.configurator" version="3.3.200" match="greaterOrEqual"/>
       <import plugin="org.eclipse.e4.ui.css.swt.theme" version="0.9.100" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.e4.ui.css.swt" version="0.11.0" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.e4.ui.css.core" version="0.10.100" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.equinox.p2.updatesite" version="1.0.400" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.platform" version="4.3.0" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.equinox.util" version="1.0.500" match="greaterOrEqual"/>
       <import plugin="org.eclipse.equinox.p2.operations"/>
       <import plugin="org.eclipse.equinox.p2.metadata" version="2.2.0" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.equinox.p2.director"/>
       <import plugin="org.eclipse.equinox.p2.ui.discovery" version="1.0.0" match="greaterOrEqual"/>
       <import plugin="org.eclipse.equinox.p2.discovery" version="1.0.200" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.equinox.p2.discovery.compatibility" version="1.0.101" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.swt"/>
       <import plugin="org.eclipse.equinox.p2.repository" version="2.3.0" match="greaterOrEqual"/>
       <import plugin="org.eclipse.equinox.p2.core" version="2.3.0" match="greaterOrEqual"/>
       <import plugin="org.eclipse.equinox.p2.engine" version="2.3.0" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.equinox.p2.console" version="1.0.300" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.ui.net" version="1.2.200" match="greaterOrEqual"/>
       <import plugin="org.eclipse.e4.ui.model.workbench"/>
       <import plugin="org.eclipse.e4.ui.workbench" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.e4.core.contexts" version="1.3.0" match="greaterOrEqual"/>
       <import plugin="org.eclipse.core.expressions" version="3.4.600" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.ui.navigator" version="3.5.300" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.ui.navigator.resources" version="3.4.500" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.e4.ui.di"/>
-      <import plugin="org.eclipse.ui.themes" version="1.0.1" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.core.resources" version="3.9.1" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.ui.workbench.texteditor" version="3.9.0" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.e4.ui.bindings" version="0.10.200" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.osgi.services" version="3.4.0" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.osgi.util" version="3.3.0" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.equinox.p2.reconciler.dropins" version="1.1.200" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.ui.views.log" version="1.0.500" match="greaterOrEqual"/>
-      <import plugin="org.txm.searchengine.cqp.core" version="1.1.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.chartsengine.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.chartsengine.jfreechart.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.chartsengine.r.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.specificities.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.statsengine.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.statsengine.r.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.searchengine.core" version="1.0.0" match="greaterOrEqual"/>
       <import plugin="org.txm.groovy.core"/>
-      <import plugin="org.eclipse.jface" version="3.9.0" match="compatible"/>
+      <import plugin="org.eclipse.equinox.p2.director"/>
+      <import plugin="org.eclipse.osgi.util" version="3.3.0" match="greaterOrEqual"/>
       <import plugin="org.eclipse.core.net" version="1.2.200" match="greaterOrEqual"/>
       <import plugin="org.eclipse.core.runtime" version="3.6.0" match="compatible"/>
       <import plugin="org.eclipse.help" version="3.2.0" match="compatible"/>
+      <import plugin="org.eclipse.jface" version="3.9.0" match="compatible"/>
       <import plugin="org.eclipse.swt" version="3.101.0" match="compatible"/>
       <import plugin="org.eclipse.jface.databinding" version="1.3.0" match="compatible"/>
       <import plugin="org.eclipse.core.databinding.property" version="1.2.0" match="compatible"/>
@@ -277,14 +236,10 @@
       <import plugin="org.eclipse.e4.ui.workbench3" version="0.12.0" match="greaterOrEqual"/>
       <import plugin="org.eclipse.e4.ui.workbench.addons.swt" version="0.10.0" match="greaterOrEqual"/>
       <import plugin="org.eclipse.emf.ecore" version="2.7.0" match="greaterOrEqual"/>
-      <import plugin="com.ibm.icu"/>
-      <import plugin="javax.annotation"/>
-      <import plugin="javax.inject"/>
-      <import plugin="org.eclipse.e4.core.commands"/>
-      <import plugin="org.eclipse.e4.ui.workbench.renderers.swt"/>
       <import plugin="org.eclipse.e4.ui.services"/>
-      <import plugin="org.eclipse.emf.common"/>
-      <import plugin="javax.xml"/>
+      <import plugin="org.eclipse.emf.ecore.xmi" version="2.11.0" match="greaterOrEqual"/>
+      <import plugin="org.eclipse.e4.core.di.extensions" version="0.13.0" match="greaterOrEqual"/>
+      <import plugin="org.eclipse.e4.core.contexts" version="1.6.0" match="greaterOrEqual"/>
    </requires>
 
    <plugin
@@ -368,4 +323,17 @@
          version="0.0.0"
          unpack="false"/>
 
+   <plugin
+         id="org.eclipse.ui.themes"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"/>
+
+   <plugin
+         id="org.eclipse.e4.ui.css.swt.theme"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
 </feature>
Index: tmp/org.txm.cooccurrence.rcp/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.cooccurrence.rcp/META-INF/MANIFEST.MF	(revision 880)
+++ tmp/org.txm.cooccurrence.rcp/META-INF/MANIFEST.MF	(revision 881)
@@ -2,19 +2,9 @@
 Export-Package: org.txm.cooccurrence.rcp.adapters,org.txm.cooccurrence
  .rcp.editors,org.txm.cooccurrence.rcp.handlers,org.txm.cooccurrence.r
  cp.messages,org.txm.cooccurrence.rcp.preferences
-Require-Bundle: org.txm.utils;visibility:=reexport,
- org.eclipse.osgi;bundle-version="3.10.2";visibility:=reexport,
- org.eclipse.core.runtime;bundle-version="3.10.0";visibility:=reexport,
- org.txm.searchengine.cqp.core;bundle-version="1.1.0";visibility:=reexport,
- org.txm.cooccurrence.core;bundle-version="1.0.0";visibility:=reexport,
- org.txm.concordance.core;bundle-version="1.0.0";visibility:=reexport,
- org.txm.statsengine.r.rcp;bundle-version="1.0.0";visibility:=reexport,
- org.eclipse.ui;bundle-version="3.106.1";visibility:=reexport,
- org.txm.core;visibility:=reexport,
- org.txm.rcp;visibility:=reexport,
- org.eclipse.core.expressions;bundle-version="3.4.600";visibility:=reexport,
- org.txm.searchengine.core;bundle-version="1.0.0";visibility:=reexport,
- org.txm.links.rcp;bundle-version="1.0.0"
+Require-Bundle: org.txm.statsengine.r.rcp;bundle-version="1.0.0";visibility:=reexport,
+ org.txm.links.rcp;bundle-version="1.0.0";visibility:=reexport,
+ org.txm.cooccurrence.core;bundle-version="1.0.0";visibility:=reexport
 Bundle-Vendor: Textometrie.org
 Bundle-Version: 1.0.0.qualifier
 Bundle-Name: Cooccurence RCP
Index: tmp/org.txm.referencer.feature/feature.xml
===================================================================
--- tmp/org.txm.referencer.feature/feature.xml	(revision 880)
+++ tmp/org.txm.referencer.feature/feature.xml	(revision 881)
@@ -17,19 +17,9 @@
    </license>
 
    <requires>
-      <import plugin="org.txm.utils" version="1.0.0" match="greaterOrEqual"/>
       <import plugin="org.txm.statsengine.r.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.core" version="0.7.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.searchengine.core" version="1.0.0" match="greaterOrEqual"/>
       <import plugin="org.txm.searchengine.cqp.core" version="1.1.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.referencer.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.concordance.core" version="1.0.0" match="greaterOrEqual"/>
       <import plugin="org.txm.concordance.rcp" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.statsengine.r.rcp" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.ui"/>
-      <import plugin="org.eclipse.core.runtime"/>
-      <import plugin="org.txm.rcp" version="0.7.8" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.core.expressions" version="3.4.600" match="greaterOrEqual"/>
    </requires>
 
    <plugin
Index: tmp/org.txm.information.core/.classpath
===================================================================
--- tmp/org.txm.information.core/.classpath	(revision 880)
+++ tmp/org.txm.information.core/.classpath	(revision 881)
@@ -1,7 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
+		<accessrules>
+			<accessrule kind="accessible" pattern="**"/>
+		</accessrules>
+	</classpathentry>
 	<classpathentry kind="src" path="src"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
Index: tmp/org.txm.information.core/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.information.core/META-INF/MANIFEST.MF	(revision 880)
+++ tmp/org.txm.information.core/META-INF/MANIFEST.MF	(revision 881)
@@ -3,9 +3,7 @@
  org.txm.properties.core.functions,
  org.txm.properties.core.messages,
  org.txm.properties.core.preferences
-Require-Bundle: org.txm.utils;visibility:=reexport,org.txm.core;bundle
- -version="0.8.0";visibility:=reexport,org.txm.searchengine.cqp.core;b
- undle-version="1.1.0";visibility:=reexport
+Require-Bundle: org.txm.searchengine.cqp.core;bundle-version="1.1.0";visibility:=reexport
 Bundle-Vendor: Textometrie.org
 Bundle-Version: 1.0.0.qualifier
 Bundle-Name: Information Core
Index: tmp/org.txm.specificities.feature/feature.xml
===================================================================
--- tmp/org.txm.specificities.feature/feature.xml	(revision 880)
+++ tmp/org.txm.specificities.feature/feature.xml	(revision 881)
@@ -17,25 +17,9 @@
    </license>
 
    <requires>
-      <import plugin="org.txm.utils" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.osgi" version="3.10.2" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.core.runtime" version="3.10.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.searchengine.cqp.core" version="1.1.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.statsengine.r.core"/>
       <import plugin="org.txm.lexicaltable.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.statsengine.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.core" version="0.7.0" match="greaterOrEqual"/>
       <import plugin="org.txm.progression.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.chartsengine.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.chartsengine.jfreechart.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.chartsengine.r.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.ui" version="3.106.1" match="greaterOrEqual"/>
-      <import plugin="org.txm.index.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.statsengine.r.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.statsengine.r.rcp"/>
       <import plugin="org.txm.chartsengine.rcp"/>
-      <import plugin="org.txm.rcp" version="0.7.8" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.core.expressions" version="3.4.600" match="greaterOrEqual"/>
       <import plugin="org.txm.lexicaltable.rcp"/>
    </requires>
 
Index: tmp/org.txm.progression.core/.classpath
===================================================================
--- tmp/org.txm.progression.core/.classpath	(revision 880)
+++ tmp/org.txm.progression.core/.classpath	(revision 881)
@@ -1,7 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
+		<accessrules>
+			<accessrule kind="accessible" pattern="**"/>
+		</accessrules>
+	</classpathentry>
 	<classpathentry kind="src" path="src"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
Index: tmp/org.txm.progression.core/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.progression.core/META-INF/MANIFEST.MF	(revision 880)
+++ tmp/org.txm.progression.core/META-INF/MANIFEST.MF	(revision 881)
@@ -1,14 +1,7 @@
 Manifest-Version: 1.0
-Require-Bundle: org.txm.utils;bundle-version="1.0.0";visibility:=reexp
- ort,org.txm.statsengine.core;bundle-version="1.0.0";visibility:=reexp
- ort,org.txm.statsengine.r.core;bundle-version="1.0.0";visibility:=ree
- xport,org.txm.chartsengine.core;visibility:=reexport,org.eclipse.core
- .runtime;visibility:=reexport,org.txm.core;bundle-version="0.7.0";vis
- ibility:=reexport,org.txm.chartsengine.jfreechart.core;bundle-version
- ="1.0.0";visibility:=reexport,org.txm.chartsengine.r.core;bundle-vers
- ion="1.0.0";visibility:=reexport,org.txm.searchengine.core;bundle-ver
- sion="1.0.0";visibility:=reexport,org.txm.searchengine.cqp.core;bundl
- e-version="1.1.0";visibility:=reexport
+Require-Bundle: org.txm.chartsengine.jfreechart.core;bundle-version="1.0.0";visibility:=reexport,
+ org.txm.chartsengine.r.core;bundle-version="1.0.0";visibility:=reexport,
+ org.txm.searchengine.cqp.core;bundle-version="1.1.0";visibility:=reexport
 Export-Package: org.txm.progression.core,
  org.txm.progression.core.chartsengine.base,
  org.txm.progression.core.chartsengine.jfreechart,
Index: tmp/org.txm.libs.cqp.macosx/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.libs.cqp.macosx/META-INF/MANIFEST.MF	(revision 880)
+++ tmp/org.txm.libs.cqp.macosx/META-INF/MANIFEST.MF	(revision 881)
@@ -3,7 +3,7 @@
 Bundle-Name: org.txm.libs.cqp.macosx
 Bundle-SymbolicName: org.txm.libs.cqp.macosx
 Bundle-Version: 1.1.0.qualifier
-Fragment-Host: org.txm.libs.cqp;bundle-version="1.0.0.qualifier"
+Fragment-Host: org.txm.libs.cqp
 Bundle-RequiredExecutionEnvironment: JavaSE-1.7
 Bundle-Vendor: Textometrie.org
 Eclipse-PlatformFilter: (osgi.os=macosx)
Index: tmp/org.txm.libs.cqp.macosx/.project
===================================================================
--- tmp/org.txm.libs.cqp.macosx/.project	(revision 880)
+++ tmp/org.txm.libs.cqp.macosx/.project	(revision 881)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <projectDescription>
-	<name>CQP.macosx</name>
+	<name>org.txm.libs.cqp.macosx</name>
 	<comment></comment>
 	<projects>
 	</projects>
Index: tmp/org.txm.specificities.rcp/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.specificities.rcp/META-INF/MANIFEST.MF	(revision 880)
+++ tmp/org.txm.specificities.rcp/META-INF/MANIFEST.MF	(revision 881)
@@ -1,19 +1,7 @@
 Manifest-Version: 1.0
-Require-Bundle: org.txm.utils;bundle-version="1.0.0";visibility:=reexp
- ort,org.eclipse.osgi;bundle-version="3.10.2";visibility:=reexport,org
- .eclipse.ui;bundle-version="3.106.1";visibility:=reexport,org.eclipse
- .core.runtime;bundle-version="3.10.0";visibility:=reexport,org.txm.le
- xicaltable.core;bundle-version="1.0.0";visibility:=reexport,org.txm.i
- ndex.core;bundle-version="1.0.0";visibility:=reexport,org.txm.statsen
- gine.core;bundle-version="1.0.0";visibility:=reexport,org.txm.statsen
- gine.r.core;bundle-version="1.0.0";visibility:=reexport,org.txm.searc
- hengine.cqp.core;bundle-version="1.1.0";visibility:=reexport,org.txm.
- core;bundle-version="0.7.0";visibility:=reexport,org.txm.statsengine.
- r.rcp;visibility:=reexport,org.txm.specificities.core;visibility:=ree
- xport,org.txm.chartsengine.rcp;visibility:=reexport,org.txm.rcp;bundl
- e-version="0.7.8";visibility:=reexport,org.eclipse.core.expressions;b
- undle-version="3.4.600";visibility:=reexport,org.txm.lexicaltable.rcp
- ;visibility:=reexport,org.txm.chartsengine.core;visibility:=reexport
+Require-Bundle: org.txm.chartsengine.rcp;visibility:=reexport,
+ org.txm.lexicaltable.rcp;visibility:=reexport,
+ org.txm.specificities.core;bundle-version="1.0.0";visibility:=reexport
 Export-Package: org.txm.specificities.rcp.adapters,org.txm.specificiti
  es.rcp.editors,org.txm.specificities.rcp.handlers,org.txm.specificiti
  es.rcp.messages,org.txm.specificities.rcp.preferences
Index: tmp/org.txm.synopticeditor.feature/feature.xml
===================================================================
--- tmp/org.txm.synopticeditor.feature/feature.xml	(revision 880)
+++ tmp/org.txm.synopticeditor.feature/feature.xml	(revision 881)
@@ -67,17 +67,7 @@
    </license>
 
    <requires>
-      <import plugin="org.txm.searchengine.cqp.core" version="1.1.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.searchengine.core" version="1.0.0" match="greaterOrEqual"/>
       <import plugin="org.txm.concordance.rcp" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.core" version="0.7.0" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.ui"/>
-      <import plugin="org.eclipse.core.runtime"/>
-      <import plugin="org.txm.rcp" version="0.7.5" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.ui.browser" version="3.4.100" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.jface.databinding" version="1.6.200" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.jface.text" version="3.9.2" match="greaterOrEqual"/>
-      <import plugin="org.txm.links.rcp" version="1.0.0" match="greaterOrEqual"/>
    </requires>
 
    <plugin
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/setup/BuildTXMHTMLDoc.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/setup/BuildTXMHTMLDoc.groovy	(revision 880)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/setup/BuildTXMHTMLDoc.groovy	(revision 881)
@@ -1,3 +1,5 @@
+package org.txm.setup
+
 import java.io.File;
 
 import org.txm.macro.txt.SearchReplaceInDirectoryMacro;
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/tal/stanford/StanfordSegmenterMacro.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/tal/stanford/StanfordSegmenterMacro.groovy	(revision 880)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/tal/stanford/StanfordSegmenterMacro.groovy	(revision 881)
@@ -1,4 +1,5 @@
 // STANDARD DECLARATIONS
+package org.txm.tal.stanford
 
 import org.kohsuke.args4j.*
 import groovy.transform.Field
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/tal/stanford/StanfordTaggerMacro.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/tal/stanford/StanfordTaggerMacro.groovy	(revision 880)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/tal/stanford/StanfordTaggerMacro.groovy	(revision 881)
@@ -1,3 +1,4 @@
+package org.txm.tal.stanford
 import edu.stanford.nlp.ling.*
 import edu.stanford.nlp.process.*
 import edu.stanford.nlp.tagger.maxent.*;
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/debug/GroovyVersionMacro.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/debug/GroovyVersionMacro.groovy	(revision 880)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/debug/GroovyVersionMacro.groovy	(revision 881)
@@ -1,5 +1,5 @@
 // Copyright © 2016 ENS de Lyon, CNRS, University of Franche-Comté
 // Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
 // @author sheiden
-
+package org.txm.macro.debug
 println GroovySystem.version
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/debug/JavascriptVersionMacro.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/debug/JavascriptVersionMacro.groovy	(revision 880)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/debug/JavascriptVersionMacro.groovy	(revision 881)
@@ -1,7 +1,7 @@
 // Copyright © 2016 ENS de Lyon, CNRS, University of Franche-Comté
 // Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
 // @author sheiden
-
+package org.txm.macro.debug
 import javax.script.*
 
 manager = new ScriptEngineManager()
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/debug/XSLTVersionMacro.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/debug/XSLTVersionMacro.groovy	(revision 880)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/debug/XSLTVersionMacro.groovy	(revision 881)
@@ -1,7 +1,7 @@
 // Copyright © 2016 ENS de Lyon, CNRS, University of Franche-Comté
 // Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
 // @author sheiden
-
+package org.txm.macro.debug
 import net.sf.saxon.Version
 
 println "XSLT "+Version.getXSLVersionString()+" ("+Version.getProductTitle()+" - "+Version.getReleaseDate()+")"
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/debug/OperatingSystemVersionMacro.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/debug/OperatingSystemVersionMacro.groovy	(revision 880)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/debug/OperatingSystemVersionMacro.groovy	(revision 881)
@@ -1,7 +1,7 @@
 // Copyright © 2016 ENS de Lyon, CNRS, University of Franche-Comté
 // Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
 // @author sheiden
-
+package org.txm.macro.debug
 System.properties.each { key, value ->
 	if (key ==~ /^os\..*/) {
 		println sprintf("%10s = %s", key, value)
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/debug/JavaVersionMacro.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/debug/JavaVersionMacro.groovy	(revision 880)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/debug/JavaVersionMacro.groovy	(revision 881)
@@ -1,5 +1,5 @@
 // Copyright © 2016 ENS de Lyon, CNRS, University of Franche-Comté
 // Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
 // @author sheiden
-
+package org.txm.macro.debug
 println System.properties.'java.version'
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/debug/RVersionMacro.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/debug/RVersionMacro.groovy	(revision 880)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/debug/RVersionMacro.groovy	(revision 881)
@@ -1,7 +1,7 @@
 // Copyright © 2016 ENS de Lyon, CNRS, University of Franche-Comté
 // Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
 // @author sheiden
-
+package org.txm.macro.debug
 def r = RWorkspace.getRWorkspaceInstance()
 
 println r.eval("R.version.string").asString()
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/debug/BrowserVersionMacro.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/debug/BrowserVersionMacro.groovy	(revision 880)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/debug/BrowserVersionMacro.groovy	(revision 881)
@@ -1,6 +1,7 @@
 // Copyright © 2016 ENS de Lyon, CNRS, University of Franche-Comté
 // Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
 // @author sheiden
+package org.txm.macro.debug
 
 import org.eclipse.ui.*
 import org.eclipse.ui.browser.*
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/test/ReleaseFunctionsValidation.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/test/ReleaseFunctionsValidation.groovy	(revision 880)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/test/ReleaseFunctionsValidation.groovy	(revision 881)
@@ -1,4 +1,4 @@
-//package org.txm.test
+package org.txm.test
 //import org.txm.*
 //import org.txm.functions.*
 //import org.txm.functions.ca.*
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/test/WGet.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/test/WGet.groovy	(revision 880)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/test/WGet.groovy	(revision 881)
@@ -1,3 +1,5 @@
+package org.txm.test
+
 URL url = new URL("http://docs.codehaus.org/display/GROOVY/Simple+file+download+from+URL");
 File outFile = new File("test.out")
 
Index: tmp/org.txm.groovy.core/src/groovy/tests/tests_groovy.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/tests/tests_groovy.groovy	(revision 880)
+++ tmp/org.txm.groovy.core/src/groovy/tests/tests_groovy.groovy	(revision 881)
@@ -1 +1,2 @@
+package tests
 print(Progression5)
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/GroovyPreferences.java
===================================================================
--- tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/GroovyPreferences.java	(revision 0)
+++ tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/GroovyPreferences.java	(revision 881)
@@ -0,0 +1,12 @@
+package org.txm.groovy.core;
+import org.txm.core.preferences.TXMPreferences;
+
+public class GroovyPreferences extends TXMPreferences {
+	
+	public static final String PREFERENCES_NODE = GroovyPreferences.class.getName();//FrameworkUtil.getBundle(RPreferences.class).getSymbolicName();
+
+	@Override
+	public void initializeDefaultPreferences() {
+		// TODO Auto-generated method stub
+	}
+}

Property changes on: tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/GroovyPreferences.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.groovy.core/build.properties
===================================================================
--- tmp/org.txm.groovy.core/build.properties	(revision 880)
+++ tmp/org.txm.groovy.core/build.properties	(revision 881)
@@ -4,7 +4,5 @@
                .,\
                bin/,\
                plugin.xml,\
-               src/groovy/org/,\
-               src/groovy/filters/,\
-               src/groovy/tests/
+               src/groovy/
 jars.compile.order = .
Index: tmp/org.txm.groovy.core/.settings/org.eclipse.jdt.groovy.core.prefs
===================================================================
--- tmp/org.txm.groovy.core/.settings/org.eclipse.jdt.groovy.core.prefs	(revision 880)
+++ tmp/org.txm.groovy.core/.settings/org.eclipse.jdt.groovy.core.prefs	(revision 881)
@@ -1,2 +1,3 @@
 eclipse.preferences.version=1
-groovy.compiler.level=23
+groovy.compiler.level=-1
+groovy.script.filters=**/*.dsld,y,**/*.gradle,n
Index: tmp/org.txm.groovy.core/.classpath
===================================================================
--- tmp/org.txm.groovy.core/.classpath	(revision 880)
+++ tmp/org.txm.groovy.core/.classpath	(revision 881)
@@ -1,10 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-	<classpathentry kind="src" path="src/groovy"/>
 	<classpathentry kind="src" path="src/java"/>
 	<classpathentry exported="true" kind="lib" path="bin/"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
+		<accessrules>
+			<accessrule kind="accessible" pattern="**"/>
+		</accessrules>
+	</classpathentry>
 	<classpathentry kind="con" path="GROOVY_DSL_SUPPORT"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
Index: tmp/org.txm.groovy.core/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.groovy.core/META-INF/MANIFEST.MF	(revision 880)
+++ tmp/org.txm.groovy.core/META-INF/MANIFEST.MF	(revision 881)
@@ -1,65 +1,5 @@
 Manifest-Version: 1.0
-Require-Bundle: org.txm.libs.groovy-all;bundle-version="2.3.3";visibil
- ity:=reexport,org.txm.utils;bundle-version="1.0.0";visibility:=reexpo
- rt,org.eclipse.osgi;bundle-version="3.10.2";visibility:=reexport,org.
- eclipse.core.runtime;bundle-version="3.10.0";visibility:=reexport,org
- .txm.searchengine.cqp.core;bundle-version="1.1.0";visibility:=reexpor
- t,org.txm.concordance.core;bundle-version="1.0.0";visibility:=reexpor
- t,org.txm.statsengine.r.core;bundle-version="1.0.0";visibility:=reexp
- ort,org.txm.ca.core;bundle-version="1.0.0";visibility:=reexport,org.t
- xm.ahc.core;bundle-version="1.0.0";visibility:=reexport,org.txm.chart
- sengine.core;bundle-version="1.0.0";visibility:=reexport,org.txm.char
- tsengine.jfreechart.core;bundle-version="1.0.0";visibility:=reexport,
- org.txm.chartsengine.r.core;bundle-version="1.0.0";visibility:=reexpo
- rt,org.txm.cooccurrence.core;bundle-version="1.0.0";visibility:=reexp
- ort,org.txm.core;bundle-version="0.7.0";visibility:=reexport,org.txm.
- index.core;bundle-version="1.0.0";visibility:=reexport,org.txm.lexica
- ltable.core;bundle-version="1.0.0";visibility:=reexport,org.txm.libs.
- batik;bundle-version="0.0.0";visibility:=reexport,org.txm.libs.colt;b
- undle-version="1.2.0";visibility:=reexport,org.txm.libs.itext;bundle-
- version="2.1.5";visibility:=reexport,org.txm.libs.jfreechart;bundle-v
- ersion="1.0.17";visibility:=reexport,org.txm.libs.jfreesvg;bundle-ver
- sion="1.7.0";visibility:=reexport,org.txm.libs.rserve;bundle-version=
- "0.0.0";visibility:=reexport,org.txm.libs.saxon;bundle-version="9.0.0
- ";visibility:=reexport,org.txm.partition.core;bundle-version="1.0.0";
- visibility:=reexport,org.txm.progression.core;bundle-version="1.0.0";
- visibility:=reexport,org.txm.specificities.core;bundle-version="1.0.0
- ";visibility:=reexport,org.txm.statsengine.core;bundle-version="1.0.0
- ";visibility:=reexport,org.txm.referencer.core;bundle-version="1.0.0"
- ;visibility:=reexport,org.txm.libs.cqp;bundle-version="1.0.0";visibil
- ity:=reexport,org.txm.searchengine.core;bundle-version="1.0.0";visibi
- lity:=reexport,org.eclipse.swt;bundle-version="3.103.2";visibility:=r
- eexport,org.txm.properties.core;bundle-version="1.0.0";visibility:=re
- export
-Export-Package: .,filters.BuildXmlLiturgie,filters.Concatenator,filter
- s.CutHeader,filters.EliminateWhiteSpaces,filters.FusionHeader,filters
- .FusionXmlHeaderBody,filters.MinimalFilter,filters.OneOpenTagPerLine,
- filters.OneTagPerLine,filters.ProcessEnclitics,filters.ProcessQuotes,
- filters.RegexFilter,filters.ReunitBrokenTags,filters.ReunitBrokenWord
- s,filters.TagSentences,filters.Tokeniser,filters.WordInternalElement,
- filters.eliminateNAttributes,org.kohsuke.args4j,org.kohsuke.args4j.sp
- i,org.txm.ant,org.txm.doc,org.txm.export,org.txm.export.conll2009,org
- .txm.functions.mesures,org.txm.importer,org.txm.importer.RGAQCJ,org.t
- xm.importer.alceste,org.txm.importer.bfm,org.txm.importer.bvh,org.txm
- .importer.corptef,org.txm.importer.cqp,org.txm.importer.discours,org.
- txm.importer.doc,org.txm.importer.factiva,org.txm.importer.fleurs,org
- .txm.importer.frantext,org.txm.importer.graal,org.txm.importer.hyperb
- ase,org.txm.importer.hyperprince,org.txm.importer.lasla,org.txm.impor
- ter.limsi,org.txm.importer.perrault,org.txm.importer.teicmc,org.txm.i
- mporter.tmx,org.txm.importer.transcriber,org.txm.importer.txt,org.txm
- .importer.xml,org.txm.importer.xmltxm,org.txm.importer.xmltxmpara,org
- .txm.importer.xtz,org.txm.macro.annotation,org.txm.macro.commands,org
- .txm.macro.cqp,org.txm.macro.csv,org.txm.macro.debug,org.txm.macro.ed
- ition,org.txm.macro.export,org.txm.macro.imports,org.txm.macro.misc,o
- rg.txm.macro.oriflamms.analyse,org.txm.macro.oriflamms.prepare,org.tx
- m.macro.r,org.txm.macro.stats,org.txm.macro.text,org.txm.macro.transc
- ription,org.txm.macro.txt,org.txm.macro.xml,org.txm.macroproto,org.tx
- m.macroproto.edition,org.txm.macroproto.export,org.txm.macroproto.imp
- orter,org.txm.macroproto.partition,org.txm.macroproto.txt,org.txm.scr
- ipts,org.txm.scripts.clix,org.txm.scripts.i18n,org.txm.scripts.teitxm
- ,org.txm.scripts.tigersearch,org.txm.setup,org.txm.sw,org.txm.tal,org
- .txm.tal.melt,org.txm.tal.stanford,org.txm.test,org.txm.tokenizer,tes
- ts
+Export-Package: org.txm.groovy.core
 Bundle-ActivationPolicy: lazy
 Bundle-ClassPath: .,bin/
 Bundle-Version: 1.0.0.qualifier
@@ -67,4 +7,5 @@
 Bundle-ManifestVersion: 2
 Bundle-SymbolicName: org.txm.groovy.core;singleton:=true
 Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Require-Bundle: org.txm.core;bundle-version="0.8.0";visibility:=reexport
 
Index: tmp/org.txm.lexicaltable.feature/feature.xml
===================================================================
--- tmp/org.txm.lexicaltable.feature/feature.xml	(revision 880)
+++ tmp/org.txm.lexicaltable.feature/feature.xml	(revision 881)
@@ -17,21 +17,8 @@
    </license>
 
    <requires>
-      <import plugin="org.eclipse.osgi" version="3.10.2" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.core.runtime" version="3.10.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.utils" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.searchengine.cqp.core" version="1.1.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.statsengine.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.statsengine.r.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.core" version="0.7.0" match="greaterOrEqual"/>
       <import plugin="org.txm.index.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.ui" version="3.106.1" match="greaterOrEqual"/>
-      <import plugin="org.txm.libs.batik"/>
       <import plugin="org.txm.statsengine.r.rcp"/>
-      <import plugin="org.txm.lexicaltable.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.ca.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.rcp"/>
-      <import plugin="org.eclipse.core.expressions" version="3.4.600" match="greaterOrEqual"/>
    </requires>
 
    <plugin
Index: tmp/org.txm.properties.feature/feature.xml
===================================================================
--- tmp/org.txm.properties.feature/feature.xml	(revision 880)
+++ tmp/org.txm.properties.feature/feature.xml	(revision 881)
@@ -17,10 +17,9 @@
    </license>
 
    <requires>
-      <import plugin="org.txm.utils"/>
-      <import plugin="org.txm.core" version="0.8.0" match="greaterOrEqual"/>
       <import plugin="org.txm.searchengine.cqp.core" version="1.1.0" match="greaterOrEqual"/>
       <import plugin="org.eclipse.ui" version="3.106.1" match="greaterOrEqual"/>
+      <import plugin="org.txm.utils"/>
       <import plugin="org.txm.properties.core" version="1.0.0" match="greaterOrEqual"/>
       <import plugin="org.eclipse.core.runtime" version="3.10.0" match="greaterOrEqual"/>
       <import plugin="org.txm.rcp" version="0.8.0" match="greaterOrEqual"/>
Index: tmp/org.txm.index.core/.classpath
===================================================================
--- tmp/org.txm.index.core/.classpath	(revision 880)
+++ tmp/org.txm.index.core/.classpath	(revision 881)
@@ -1,7 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
+		<accessrules>
+			<accessrule kind="accessible" pattern="**"/>
+		</accessrules>
+	</classpathentry>
 	<classpathentry kind="src" path="src"/>
 	<classpathentry kind="src" path="groovy"/>
 	<classpathentry kind="output" path="bin"/>
Index: tmp/org.txm.index.core/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.index.core/META-INF/MANIFEST.MF	(revision 880)
+++ tmp/org.txm.index.core/META-INF/MANIFEST.MF	(revision 881)
@@ -1,10 +1,6 @@
 Manifest-Version: 1.0
-Require-Bundle: org.txm.utils;bundle-version="1.0.0";visibility:=reexp
- ort,org.txm.searchengine.cqp.core;bundle-version="1.1.0";visibility:=
- reexport,org.txm.statsengine.r.core;bundle-version="1.0.0";visibility
- :=reexport,org.eclipse.core.runtime;visibility:=reexport,org.txm.core
- ;bundle-version="0.7.0";visibility:=reexport,org.txm.searchengine.cor
- e;bundle-version="1.0.0";visibility:=reexport
+Require-Bundle: org.txm.searchengine.cqp.core;bundle-version="1.1.0";visibility:=reexport,
+ org.txm.statsengine.r.core;bundle-version="1.0.0";visibility:=reexport
 Export-Package: org.txm.index.core.functions,org.txm.index.core.messag
  es,org.txm.index.core.preferences,org.txm.macro.r,org.txm.test
 Bundle-Vendor: Textometrie.org
Index: tmp/org.txm.index.feature/feature.xml
===================================================================
--- tmp/org.txm.index.feature/feature.xml	(revision 880)
+++ tmp/org.txm.index.feature/feature.xml	(revision 881)
@@ -17,20 +17,10 @@
    </license>
 
    <requires>
-      <import plugin="org.txm.utils" version="1.0.0" match="greaterOrEqual"/>
       <import plugin="org.txm.searchengine.cqp.core" version="1.1.0" match="greaterOrEqual"/>
       <import plugin="org.txm.statsengine.r.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.core.runtime"/>
-      <import plugin="org.txm.core" version="0.7.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.searchengine.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.osgi" version="3.10.2" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.core.runtime" version="3.10.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.statsengine.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.index.core" version="1.0.0" match="greaterOrEqual"/>
       <import plugin="org.txm.statsengine.r.rcp"/>
-      <import plugin="org.eclipse.ui" version="3.106.1" match="greaterOrEqual"/>
-      <import plugin="org.txm.rcp"/>
-      <import plugin="org.eclipse.core.expressions" version="3.4.600" match="greaterOrEqual"/>
+      <import plugin="org.txm.links.rcp" version="1.0.0" match="greaterOrEqual"/>
    </requires>
 
    <plugin
Index: tmp/org.txm.cooccurrence.core/.classpath
===================================================================
--- tmp/org.txm.cooccurrence.core/.classpath	(revision 880)
+++ tmp/org.txm.cooccurrence.core/.classpath	(revision 881)
@@ -1,7 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
+		<accessrules>
+			<accessrule kind="accessible" pattern="**"/>
+		</accessrules>
+	</classpathentry>
 	<classpathentry kind="src" path="src"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
Index: tmp/org.txm.cooccurrence.core/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.cooccurrence.core/META-INF/MANIFEST.MF	(revision 880)
+++ tmp/org.txm.cooccurrence.core/META-INF/MANIFEST.MF	(revision 881)
@@ -1,15 +1,6 @@
 Manifest-Version: 1.0
-Require-Bundle: org.txm.utils;bundle-version="1.0.0";visibility:=reexp
- ort,org.eclipse.osgi;bundle-version="3.10.2";visibility:=reexport,org
- .eclipse.core.runtime;bundle-version="3.10.0";visibility:=reexport,or
- g.txm.concordance.core;bundle-version="1.0.0";visibility:=reexport,or
- g.txm.statsengine.r.core;bundle-version="1.0.0";visibility:=reexport,
- org.txm.core;bundle-version="0.7.0";visibility:=reexport,org.txm.lexi
- caltable.core;visibility:=reexport,org.txm.specificities.core;bundle-
- version="1.0.0";visibility:=reexport,org.txm.index.core;bundle-versio
- n="1.0.0";visibility:=reexport,org.txm.searchengine.core;bundle-versi
- on="1.0.0";visibility:=reexport,org.txm.searchengine.cqp.core;bundle-
- version="1.1.0";visibility:=reexport
+Require-Bundle: org.txm.concordance.core;bundle-version="1.0.0";visibility:=reexport,
+ org.txm.specificities.core;bundle-version="1.0.0";visibility:=reexport
 Export-Package: org.txm.cooccurrence.core.functions,org.txm.cooccurren
  ce.core.functions.comparators,org.txm.cooccurrence.core.messages,org.
  txm.cooccurrence.core.preferences
Index: tmp/org.txm.synopticeditor.rcp/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.synopticeditor.rcp/META-INF/MANIFEST.MF	(revision 880)
+++ tmp/org.txm.synopticeditor.rcp/META-INF/MANIFEST.MF	(revision 881)
@@ -1,15 +1,6 @@
 Manifest-Version: 1.0
-Require-Bundle: org.txm.searchengine.cqp.core;bundle-version="1.1.0";visibility:=reexport,
- org.txm.searchengine.core;bundle-version="1.0.0";visibility:=reexport,
- org.txm.concordance.rcp;bundle-version="1.0.0";visibility:=reexport,
- org.txm.core;bundle-version="0.7.0";visibility:=reexport,
- org.eclipse.ui;visibility:=reexport,
- org.eclipse.core.runtime;visibility:=reexport,
- org.txm.rcp;bundle-version="0.7.5";visibility:=reexport,
- org.eclipse.ui.browser;bundle-version="3.4.100";visibility:=reexport,
- org.eclipse.jface.databinding;bundle-version="1.6.200";visibility:=reexport,
- org.eclipse.jface.text;bundle-version="3.9.2";visibility:=reexport,
- org.txm.links.rcp;bundle-version="1.0.0"
+Require-Bundle: org.txm.concordance.rcp;bundle-version="1.0.0";visibility:=reexport,
+ org.txm.links.rcp;bundle-version="1.0.0";visibility:=reexport
 Export-Package: org.txm.edition.rcp.editors,
  org.txm.edition.rcp.handlers,
  org.txm.edition.rcp.messages,
Index: tmp/org.txm.synopticeditor.rcp/src/org/txm/edition/rcp/editors/EditionPanel.java
===================================================================
--- tmp/org.txm.synopticeditor.rcp/src/org/txm/edition/rcp/editors/EditionPanel.java	(revision 880)
+++ tmp/org.txm.synopticeditor.rcp/src/org/txm/edition/rcp/editors/EditionPanel.java	(revision 881)
@@ -578,8 +578,9 @@
 	public void lastPage() {
 		// System.out.println(Messages.TxmBrowser_2+currentPage);
 
-		if (currentPage != null && currentPage.getFile().equals(currentEdition.getLastPage().getFile()))
+		if (currentPage != null && currentPage.getFile().equals(currentEdition.getLastPage().getFile())) {
 			return;
+		}
 		currentPage = currentEdition.getLastPage();
 		currentText = currentEdition.getText();
 		this.setURL(currentPage.toURL());
@@ -600,8 +601,9 @@
 				this.setURL(currentPage.toURL());
 			}
 			currentText = currentEdition.getText();
-		} else
+		} else {
 			firstPage();
+		}
 		//page_label.setText(makePageLabel());
 	}
 
@@ -621,8 +623,9 @@
 				this.setURL(currentPage.toURL());
 			}
 			currentText = currentEdition.getText();
-		} else
+		} else {
 			firstPage();
+		}
 		//page_label.setText(makePageLabel());
 	}
 
@@ -761,7 +764,9 @@
 			return;
 		}
 
-		if (refresh) this.setURL(currentPage.toURL());
+		if (refresh) {
+			this.setURL(currentPage.toURL());
+		}
 		//page_label.setText(makePageLabel());
 	}
 
Index: tmp/org.txm.progression.feature/feature.xml
===================================================================
--- tmp/org.txm.progression.feature/feature.xml	(revision 880)
+++ tmp/org.txm.progression.feature/feature.xml	(revision 881)
@@ -17,31 +17,12 @@
    </license>
 
    <requires>
-      <import plugin="org.txm.utils" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.statsengine.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.statsengine.r.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.chartsengine.core"/>
-      <import plugin="org.eclipse.core.runtime"/>
-      <import plugin="org.txm.core" version="0.7.0" match="greaterOrEqual"/>
       <import plugin="org.txm.chartsengine.jfreechart.core" version="1.0.0" match="greaterOrEqual"/>
       <import plugin="org.txm.chartsengine.r.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.searchengine.core" version="1.0.0" match="greaterOrEqual"/>
       <import plugin="org.txm.searchengine.cqp.core" version="1.1.0" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.osgi" version="3.10.2" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.core.runtime" version="3.10.0" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.ui" version="3.106.1" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.e4.ui.workbench" version="1.2.2" match="greaterOrEqual"/>
-      <import plugin="org.txm.concordance.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.concordance.rcp"/>
       <import plugin="org.txm.edition.rcp"/>
-      <import plugin="org.txm.progression.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.chartsengine.svgbatik.rcp" version="1.0.0" match="greaterOrEqual"/>
       <import plugin="org.txm.lexicaltable.rcp" version="1.0.0" match="greaterOrEqual"/>
       <import plugin="org.txm.chartsengine.rcp" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.ui.workbench"/>
-      <import plugin="org.eclipse.swt"/>
-      <import plugin="org.eclipse.core.expressions" version="3.4.600" match="greaterOrEqual"/>
-      <import plugin="org.txm.rcp"/>
    </requires>
 
    <plugin
Index: tmp/org.txm.concordance.feature/feature.xml
===================================================================
--- tmp/org.txm.concordance.feature/feature.xml	(revision 880)
+++ tmp/org.txm.concordance.feature/feature.xml	(revision 881)
@@ -18,20 +18,9 @@
    </license>
 
    <requires>
-      <import plugin="org.txm.utils" version="1.0.0" match="greaterOrEqual"/>
       <import plugin="org.txm.searchengine.cqp.core" version="1.1.0" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.osgi" version="3.10.2" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.core.runtime" version="3.10.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.core"/>
-      <import plugin="org.txm.searchengine.core" version="1.0.0" match="greaterOrEqual"/>
       <import plugin="org.txm.statsengine.r.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.ui" version="3.106.1" match="greaterOrEqual"/>
-      <import plugin="org.txm.cooccurrence.core" version="1.0.0" match="greaterOrEqual"/>
       <import plugin="org.txm.cooccurrence.rcp" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.e4.ui.workbench" version="1.2.2" match="greaterOrEqual"/>
-      <import plugin="org.txm.rcp"/>
-      <import plugin="org.eclipse.core.expressions" version="3.4.600" match="greaterOrEqual"/>
-      <import plugin="org.txm.internalview.core" version="1.0.0" match="greaterOrEqual"/>
       <import plugin="org.txm.internalview.rcp" version="1.0.0" match="greaterOrEqual"/>
    </requires>
 
Index: tmp/org.txm.statsengine.core/.classpath
===================================================================
--- tmp/org.txm.statsengine.core/.classpath	(revision 880)
+++ tmp/org.txm.statsengine.core/.classpath	(revision 881)
@@ -1,7 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
+		<accessrules>
+			<accessrule kind="accessible" pattern="**"/>
+		</accessrules>
+	</classpathentry>
 	<classpathentry kind="src" path="src"/>
 	<classpathentry kind="src" path="res"/>
 	<classpathentry kind="output" path="bin"/>
Index: tmp/org.txm.statsengine.core/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.statsengine.core/META-INF/MANIFEST.MF	(revision 880)
+++ tmp/org.txm.statsengine.core/META-INF/MANIFEST.MF	(revision 881)
@@ -1,10 +1,7 @@
 Manifest-Version: 1.0
 Export-Package: org.txm.statsengine.core,org.txm.statsengine.core.data
  ,org.txm.statsengine.core.messages,org.txm.statsengine.core.utils
-Require-Bundle: org.txm.utils;bundle-version="1.0.0";visibility:=reexp
- ort,org.eclipse.osgi;bundle-version="3.10.2";visibility:=reexport,org
- .eclipse.core.runtime;bundle-version="3.10.0";visibility:=reexport,or
- g.txm.core;bundle-version="0.7.0";visibility:=reexport
+Require-Bundle: org.txm.core;bundle-version="0.7.0";visibility:=reexport
 Bundle-Vendor: Textometrie.org
 Bundle-Version: 1.0.0.qualifier
 Bundle-Name: Statistics Engine Core
Index: tmp/org.txm.lexicaltable.rcp/.classpath
===================================================================
--- tmp/org.txm.lexicaltable.rcp/.classpath	(revision 880)
+++ tmp/org.txm.lexicaltable.rcp/.classpath	(revision 881)
@@ -1,7 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
+		<accessrules>
+			<accessrule kind="accessible" pattern="**"/>
+		</accessrules>
+	</classpathentry>
 	<classpathentry kind="src" path="src"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
Index: tmp/org.txm.lexicaltable.rcp/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.lexicaltable.rcp/META-INF/MANIFEST.MF	(revision 880)
+++ tmp/org.txm.lexicaltable.rcp/META-INF/MANIFEST.MF	(revision 881)
@@ -1,18 +1,6 @@
 Manifest-Version: 1.0
-Require-Bundle: org.eclipse.osgi;bundle-version="3.10.2";visibility:=r
- eexport,org.eclipse.core.runtime;bundle-version="3.10.0";visibility:=
- reexport,org.txm.utils;bundle-version="1.0.0";visibility:=reexport,or
- g.eclipse.ui;bundle-version="3.106.1";visibility:=reexport,org.txm.li
- bs.batik;visibility:=reexport,org.txm.statsengine.core;bundle-version
- ="1.0.0";visibility:=reexport,org.txm.statsengine.r.core;bundle-versi
- on="1.0.0";visibility:=reexport,org.txm.statsengine.r.rcp;visibility:
- =reexport,org.txm.searchengine.cqp.core;bundle-version="1.1.0";visibi
- lity:=reexport,org.txm.index.core;bundle-version="1.0.0";visibility:=
- reexport,org.txm.lexicaltable.core;bundle-version="1.0.0";visibility:
- =reexport,org.txm.ca.core;bundle-version="1.0.0";visibility:=reexport
- ,org.txm.core;visibility:=reexport,org.txm.rcp;visibility:=reexport,o
- rg.eclipse.core.expressions;bundle-version="3.4.600";visibility:=reex
- port
+Require-Bundle: org.txm.statsengine.r.rcp;visibility:=reexport,
+ org.txm.lexicaltable.core;bundle-version="1.0.0";visibility:=reexport
 Export-Package: org.txm.lexicaltable.rcp.adapters,org.txm.lexicaltable
  .rcp.editors,org.txm.lexicaltable.rcp.handlers,org.txm.lexicaltable.r
  cp.messages,org.txm.lexicaltable.rcp.preferences
Index: tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/handlers/ComputeLexicalTable.java
===================================================================
--- tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/handlers/ComputeLexicalTable.java	(revision 880)
+++ tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/handlers/ComputeLexicalTable.java	(revision 881)
@@ -43,7 +43,6 @@
 //import org.txm.functions.queryindex.QueryIndex;
 import org.txm.index.core.functions.Index;
 import org.txm.lexicaltable.core.functions.LexicalTable;
-import org.txm.lexicaltable.rcp.editors.LexicalTableDialog;
 import org.txm.lexicaltable.rcp.editors.LexicalTableEditor;
 import org.txm.lexicaltable.rcp.messages.LexicalTableUIMessages;
 import org.txm.rcp.StatusLine;
@@ -65,13 +64,6 @@
  */
 public class ComputeLexicalTable extends BaseAbstractHandler {
 
-
-	/** The code. */
-	int code;
-
-	/** The d. */
-	LexicalTableDialog d;
-
 	/* (non-Javadoc)
 	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
 	 */
Index: tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/editors/LexicalTableDialog.java
===================================================================
--- tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/editors/LexicalTableDialog.java	(revision 880)
+++ tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/editors/LexicalTableDialog.java	(revision 881)
@@ -1,252 +0,0 @@
-// Copyright © 2010-2013 ENS de Lyon.
-// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
-// Lyon 2, University of Franche-Comté, University of Nice
-// Sophia Antipolis, University of Paris 3.
-// 
-// The TXM platform is free software: you can redistribute it
-// and/or modify it under the terms of the GNU General Public
-// License as published by the Free Software Foundation,
-// either version 2 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:$
-// $LastChangedRevision:$
-// $LastChangedBy:$ 
-//
-package org.txm.lexicaltable.rcp.editors;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Spinner;
-import org.txm.ca.core.preferences.CAPreferences;
-import org.txm.core.messages.TXMCoreMessages;
-import org.txm.core.preferences.TXMPreferences;
-import org.txm.lexicaltable.rcp.messages.LexicalTableUIMessages;
-import org.txm.rcp.messages.TXMUIMessages;
-import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
-import org.txm.searchengine.cqp.corpus.Corpus;
-import org.txm.searchengine.cqp.corpus.Property;
-/**
- * Retrieve the property analysis to be used for computing correspondence
- * analysis. and also the max number of entries and their minimal frequency
- * 
- * @author sjacquot
- * @author sloiseau
- * 
- */
-public class LexicalTableDialog extends Dialog {
-
-	/** The property. */
-	private Property property;
-	
-	/** The properties. */
-	private List<Property> properties;
-	
-	/** The ana prop combo. */
-	private Combo anaPropCombo;
-	
-	/** The fmin label. */
-	Label fminLabel;
-	
-	/** The maxlines label. */
-	Label maxlinesLabel;
-	
-	/** The maxlines spinner. */
-	Spinner maxlinesSpinner;
-	
-	/** The fmin spinner. */
-	Spinner fminSpinner;
-	
-	/** The corpus. */
-	Corpus corpus;
-
-	/** The title. */
-	String title;
-	
-	/** The mess. */
-	String mess;
-	
-	/** The max, default value read from CA preferences. */
-	private int vmax = TXMPreferences.getInt(CAPreferences.V_MAX, CAPreferences.PREFERENCES_NODE);
-	
-	/** The fmin, default value read from CA preferences. */
-	private int fmin = TXMPreferences.getInt(CAPreferences.F_MIN, CAPreferences.PREFERENCES_NODE);
-
-	/**
-	 * Instantiates a new compute correspondence analysis dialog.
-	 *
-	 * @param parentShell the parent shell
-	 * @param corpus the corpus
-	 */
-	public LexicalTableDialog(Shell parentShell, Corpus corpus, String title) {
-		super(parentShell);
-		try {
-			this.corpus = corpus;
-			this.title = title;
-			this.properties = new ArrayList<Property>(corpus.getOrderedProperties());
-		} catch (CqiClientException e) {
-			org.txm.rcp.utils.Logger.printStackTrace(e);
-		}
-	}
-
-	/**
-	 * Instantiates a new compute correspondence analysis dialog.
-	 *
-	 * @param parentShell the parent shell
-	 * @param corpus the corpus
-	 * @param title the title
-	 * @param mess the mess
-	 */
-	public LexicalTableDialog(Shell parentShell,
-			Corpus corpus, String title, String mess) {
-		super(parentShell);
-		this.corpus = corpus;
-		this.title = title;
-		this.mess = mess;
-		try {
-			this.properties = new ArrayList<Property>(corpus.getOrderedProperties());
-		} catch (CqiClientException e) {
-			org.txm.rcp.utils.Logger.printStackTrace(e);
-		}
-	}
-
-	/* (non-Javadoc)
-	 * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
-	 */
-	@Override
-	protected void configureShell(Shell newShell) {
-		super.configureShell(newShell);
-		newShell.setText(LexicalTableUIMessages.LexicalTablePreferencePage_0);
-		if (title != null)
-			newShell.setText(title);
-	}
-
-	/* (non-Javadoc)
-	 * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
-	 */
-	@Override
-	protected Control createDialogArea(Composite parent) {
-		Composite composite = new Composite(parent, SWT.NONE);
-		GridLayout layout = new GridLayout(2, false);
-		composite.setLayout(layout);
-
-		Label anaPropLabel = new Label(composite, SWT.NONE);
-		if (mess != null) {
-			anaPropLabel.setText(mess);
-		}
-		else {
-			anaPropLabel.setText(TXMCoreMessages.common_properties);
-		}
-		anaPropLabel.setLayoutData(new GridData(GridData.END, GridData.CENTER,
-				false, false));
-
-		anaPropCombo = new Combo(composite, SWT.READ_ONLY);
-		anaPropCombo.setLayoutData(new GridData(GridData.FILL, GridData.FILL,
-				true, false));
-		int iword= 0;
-		int i = 0;
-		for (Property p : properties) {
-			anaPropCombo.add(p.getName());
-			if (p.getName().equals(TXMPreferences.DEFAULT_UNIT_PROPERTY)) {
-				iword=i;
-			}
-			i++;
-		}
-		anaPropCombo.select(iword);
-
-		maxlinesLabel = new Label(composite, SWT.NONE);
-		maxlinesLabel.setText(TXMUIMessages.NumberOfLines);
-		maxlinesLabel.setLayoutData(new GridData(GridData.END, GridData.CENTER, true, false));
-		maxlinesSpinner = new Spinner(composite, SWT.BORDER);
-		maxlinesSpinner.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
-		maxlinesSpinner.setMaximum(9999999);
-		maxlinesSpinner.setMinimum(1);
-		maxlinesSpinner.setSelection(9999999);
-		maxlinesSpinner.setSelection(vmax);
-		
-		fminLabel = new Label(composite, SWT.NONE);
-		fminLabel.setText(TXMCoreMessages.common_fMin);
-		fminLabel.setLayoutData(new GridData(GridData.END, GridData.CENTER, true, false));
-		fminSpinner = new Spinner(composite, SWT.BORDER);
-		fminSpinner.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
-		fminSpinner.setMaximum(9999999);
-		fminSpinner.setMinimum(1);
-		fminSpinner.setSelection(fmin);
-
-		return composite;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.eclipse.jface.dialogs.Dialog#okPressed()
-	 */
-	@Override
-	protected void okPressed() {
-		int propIndex = anaPropCombo.getSelectionIndex();
-		if (propIndex == -1) {
-			MessageDialog.openError(getShell(),
-					TXMUIMessages.Invalid_analysis_property,
-					TXMUIMessages.Structure_field_not_empty);
-			return;
-		}
-		property = properties.get(propIndex);
-
-		vmax = maxlinesSpinner.getSelection();
-		fmin = fminSpinner.getSelection();
-		super.okPressed();
-	}
-
-	/**
-	 * Gets the property.
-	 *
-	 * @return the property
-	 */
-	public Property getProperty() {
-		return property;
-	}
-
-	/**
-	 * Gets the fmin.
-	 *
-	 * @return the fmin
-	 */
-	public int getFmin() {
-		return fmin;
-	}
-
-	/**
-	 * Gets the max lines.
-	 *
-	 * @return the max lines
-	 */
-	public int getMaxLines() {
-		return vmax;
-	}
-	
-	public void setFminAndVMax(int fmin, int vmax) {
-		this.fmin = fmin;
-		this.vmax = vmax;
-	}
-}
Index: tmp/org.txm.index.rcp/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.index.rcp/META-INF/MANIFEST.MF	(revision 880)
+++ tmp/org.txm.index.rcp/META-INF/MANIFEST.MF	(revision 881)
@@ -1,18 +1,7 @@
 Manifest-Version: 1.0
-Require-Bundle: org.txm.utils;bundle-version="1.0.0";visibility:=reexport,
- org.eclipse.osgi;bundle-version="3.10.2";visibility:=reexport,
- org.eclipse.core.runtime;bundle-version="3.10.0";visibility:=reexport,
- org.txm.statsengine.core;bundle-version="1.0.0";visibility:=reexport,
- org.txm.statsengine.r.core;bundle-version="1.0.0";visibility:=reexport,
- org.txm.searchengine.cqp.core;bundle-version="1.1.0";visibility:=reexport,
- org.txm.core;bundle-version="0.7.0";visibility:=reexport,
- org.txm.index.core;bundle-version="1.0.0";visibility:=reexport,
- org.txm.statsengine.r.rcp;visibility:=reexport,
- org.eclipse.ui;bundle-version="3.106.1";visibility:=reexport,
- org.txm.rcp;visibility:=reexport,
- org.eclipse.core.expressions;bundle-version="3.4.600";visibility:=reexport,
- org.txm.searchengine.core;bundle-version="1.0.0";visibility:=reexport,
- org.txm.links.rcp;bundle-version="1.0.0"
+Require-Bundle: org.txm.statsengine.r.rcp;visibility:=reexport,
+ org.txm.links.rcp;bundle-version="1.0.0";visibility:=reexport,
+ org.txm.index.core;bundle-version="1.0.0";visibility:=reexport
 Export-Package: org.txm.index.rcp.adapters,
  org.txm.index.rcp.editors,
  org.txm.index.rcp.handlers,
Index: tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/IndexToLexicalTable.java
===================================================================
--- tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/IndexToLexicalTable.java	(revision 880)
+++ tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/IndexToLexicalTable.java	(revision 881)
@@ -27,28 +27,13 @@
 //
 package org.txm.index.rcp.handlers;
 
-import java.util.ArrayList;
-
-import org.apache.batik.util.gui.CSSMediaPanel.Dialog;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.viewers.ArrayContentProvider;
 import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.LabelProvider;
 import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.ListSelectionDialog;
 import org.eclipse.ui.handlers.HandlerUtil;
-import org.txm.index.core.functions.Index;
-import org.txm.lexicaltable.core.functions.LexicalTable;
-//import org.txm.lexicaltable.rcp.editors.___LexicalTableEditorInput;
-//import org.txm.lexicaltable.rcp.messages.LexicalTableUIMessages;
-import org.txm.rcp.StatusLine;
 import org.txm.rcp.handlers.BaseAbstractHandler;
-import org.txm.rcp.messages.TXMUIMessages;
 // TODO: Auto-generated Javadoc
 /**
  * The Class IndexToLexicalTable.
Index: tmp/org.txm.searchengine.cqp.core/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.searchengine.cqp.core/META-INF/MANIFEST.MF	(revision 880)
+++ tmp/org.txm.searchengine.cqp.core/META-INF/MANIFEST.MF	(revision 881)
@@ -1,9 +1,6 @@
 Manifest-Version: 1.0
-Require-Bundle: org.eclipse.ui;visibility:=reexport,org.eclipse.core.r
- untime;visibility:=reexport,org.txm.core;bundle-version="0.7.0";visib
- ility:=reexport,org.txm.searchengine.core;bundle-version="1.0.0";visi
- bility:=reexport,org.txm.libs.cqp;bundle-version="1.0.0";visibility:=
- reexport,org.txm.utils;bundle-version="1.0.0";visibility:=reexport
+Require-Bundle: org.txm.searchengine.core;bundle-version="1.0.0";visibility:=reexport,
+ org.txm.libs.cqp;bundle-version="1.0.0";visibility:=reexport
 Export-Package: org.txm.importer.cwb,org.txm.searchengine.cqp,org.txm.
  searchengine.cqp.clientExceptions,org.txm.searchengine.cqp.core.funct
  ions.preview,org.txm.searchengine.cqp.core.functions.selection,org.tx
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/CQPSearchEngine.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/CQPSearchEngine.java	(revision 880)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/CQPSearchEngine.java	(revision 881)
@@ -392,11 +392,11 @@
 	 * @return true, if is initialized
 	 */
 	public static boolean isInitialized() {
-		return Toolbox.getEngineManager(EngineType.SEARCH).getEngine("CQP").getState();
+		return Toolbox.getEngineManager(EngineType.SEARCH).getEngine("CQP").isRunning();
 	}
 
 	@Override
-	public boolean getState() {
+	public boolean isRunning() {
 		return state;
 	}
 }
Index: tmp/org.txm.cooccurrence.feature/feature.xml
===================================================================
--- tmp/org.txm.cooccurrence.feature/feature.xml	(revision 880)
+++ tmp/org.txm.cooccurrence.feature/feature.xml	(revision 881)
@@ -18,22 +18,9 @@
    </license>
 
    <requires>
-      <import plugin="org.txm.utils" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.osgi" version="3.10.2" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.core.runtime" version="3.10.0" match="greaterOrEqual"/>
       <import plugin="org.txm.concordance.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.statsengine.r.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.core" version="0.7.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.lexicaltable.core"/>
       <import plugin="org.txm.specificities.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.index.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.searchengine.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.searchengine.cqp.core" version="1.1.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.cooccurrence.core" version="1.0.0" match="greaterOrEqual"/>
       <import plugin="org.txm.statsengine.r.rcp" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.ui" version="3.106.1" match="greaterOrEqual"/>
-      <import plugin="org.txm.rcp"/>
-      <import plugin="org.eclipse.core.expressions" version="3.4.600" match="greaterOrEqual"/>
       <import plugin="org.txm.links.rcp" version="1.0.0" match="greaterOrEqual"/>
    </requires>
 
Index: tmp/org.txm.information.rcp/.classpath
===================================================================
--- tmp/org.txm.information.rcp/.classpath	(revision 880)
+++ tmp/org.txm.information.rcp/.classpath	(revision 881)
@@ -1,7 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
+		<accessrules>
+			<accessrule kind="accessible" pattern="**"/>
+		</accessrules>
+	</classpathentry>
 	<classpathentry kind="src" path="src"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
Index: tmp/org.txm.information.rcp/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.information.rcp/META-INF/MANIFEST.MF	(revision 880)
+++ tmp/org.txm.information.rcp/META-INF/MANIFEST.MF	(revision 881)
@@ -1,10 +1,6 @@
 Manifest-Version: 1.0
-Require-Bundle: org.eclipse.ui;bundle-version="3.106.1";visibility:=re
- export,org.txm.utils;visibility:=reexport,org.txm.searchengine.cqp.co
- re;bundle-version="1.1.0";visibility:=reexport,org.txm.properties.cor
- e;bundle-version="1.0.0";visibility:=reexport,org.eclipse.core.runtim
- e;bundle-version="3.10.0";visibility:=reexport,org.txm.rcp;bundle-ver
- sion="0.8.0";visibility:=reexport
+Require-Bundle: org.txm.rcp;bundle-version="0.8.0";visibility:=reexport,
+ org.txm.properties.core;bundle-version="1.0.0";visibility:=reexport
 Bundle-Vendor: Textometrie.org
 Bundle-Version: 1.0.0.qualifier
 Bundle-Name: Information RCP
Index: tmp/org.txm.groovy.feature/feature.xml
===================================================================
--- tmp/org.txm.groovy.feature/feature.xml	(revision 880)
+++ tmp/org.txm.groovy.feature/feature.xml	(revision 881)
@@ -23,7 +23,6 @@
       <import plugin="org.eclipse.core.runtime" version="3.10.0" match="greaterOrEqual"/>
       <import plugin="org.txm.searchengine.cqp.core" version="1.1.0" match="greaterOrEqual"/>
       <import plugin="org.txm.concordance.core" version="1.0.0" match="greaterOrEqual"/>
-      <import plugin="org.txm.statsengine.r.core" version="1.0.0" match="greaterOrEqual"/>
       <import plugin="org.txm.ca.core" version="1.0.0" match="greaterOrEqual"/>
       <import plugin="org.txm.ahc.core" version="1.0.0" match="greaterOrEqual"/>
       <import plugin="org.txm.chartsengine.core" version="1.0.0" match="greaterOrEqual"/>
Index: tmp/org.txm.lexicaltable.core/.classpath
===================================================================
--- tmp/org.txm.lexicaltable.core/.classpath	(revision 880)
+++ tmp/org.txm.lexicaltable.core/.classpath	(revision 881)
@@ -1,7 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
+		<accessrules>
+			<accessrule kind="accessible" pattern="**"/>
+		</accessrules>
+	</classpathentry>
 	<classpathentry kind="src" path="src"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
Index: tmp/org.txm.lexicaltable.core/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.lexicaltable.core/META-INF/MANIFEST.MF	(revision 880)
+++ tmp/org.txm.lexicaltable.core/META-INF/MANIFEST.MF	(revision 881)
@@ -1,12 +1,5 @@
 Manifest-Version: 1.0
-Require-Bundle: org.eclipse.osgi;bundle-version="3.10.2";visibility:=r
- eexport,org.eclipse.core.runtime;bundle-version="3.10.0";visibility:=
- reexport,org.txm.utils;bundle-version="1.0.0";visibility:=reexport,or
- g.txm.searchengine.cqp.core;bundle-version="1.1.0";visibility:=reexpo
- rt,org.txm.statsengine.core;bundle-version="1.0.0";visibility:=reexpo
- rt,org.txm.statsengine.r.core;bundle-version="1.0.0";visibility:=reex
- port,org.txm.core;bundle-version="0.7.0";visibility:=reexport,org.txm
- .index.core;bundle-version="1.0.0";visibility:=reexport
+Require-Bundle: org.txm.index.core;bundle-version="1.0.0";visibility:=reexport
 Export-Package: org.txm.functions.intertextualdistance,org.txm.lexical
  table.core.functions,org.txm.lexicaltable.core.messages,org.txm.lexic
  altable.core.preferences,org.txm.lexicaltable.core.statsengine.data,o
Index: tmp/org.txm.rcp/rcpapplication.product
===================================================================
--- tmp/org.txm.rcp/rcpapplication.product	(revision 880)
+++ tmp/org.txm.rcp/rcpapplication.product	(revision 881)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?pde version="3.5"?>
 
-<product name="TXM" uid="org.txm.rcp.app" id="org.txm.rcp.product" application="org.txm.rcp.Application" version="0.8.0.qualifier" useFeatures="true" includeLaunchers="true">
+<product name="TXM" uid="org.txm.rcp.app" id="org.txm.rcp.product" application="org.txm.rcp.Application" version="0.8.0.qualifier" useFeatures="false" includeLaunchers="true">
 
    <aboutInfo>
       <image path="/org.txm.rcp/icons/logo/about TXM.png"/>
@@ -70,7 +70,6 @@
    <launcher name="TXM">
       <linux icon="/org.txm.rcp/icons/logo/TXM logo.xpm"/>
       <macosx icon="/org.txm.rcp/icons/logo/TXM logo.icns"/>
-      <solaris/>
       <win useIco="false">
          <bmp
             winSmallHigh="/org.txm.rcp/icons/logo/TXM logo 16x16 32-bit.bmp"
@@ -127,157 +126,55 @@
       <plugin id="com.ibm.icu"/>
       <plugin id="javax.annotation"/>
       <plugin id="javax.inject"/>
-      <plugin id="javax.persistence"/>
       <plugin id="javax.xml"/>
       <plugin id="org.apache.batik.css"/>
       <plugin id="org.apache.batik.util"/>
-      <plugin id="org.apache.batik.util.gui"/>
-      <plugin id="org.eclipse.compare"/>
+      <plugin id="org.apache.commons.jxpath"/>
+      <plugin id="org.apache.felix.gogo.runtime"/>
+      <plugin id="org.apache.felix.gogo.shell"/>
+      <plugin id="org.apache.felix.scr"/>
+      <plugin id="org.apache.xerces"/>
+      <plugin id="org.apache.xml.resolver"/>
+      <plugin id="org.apache.xml.serializer"/>
       <plugin id="org.eclipse.compare.core"/>
-      <plugin id="org.eclipse.compare.core.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.compare.core.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.compare.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.compare.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.core.commands"/>
-      <plugin id="org.eclipse.core.commands.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.core.commands.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.core.contenttype"/>
       <plugin id="org.eclipse.core.databinding"/>
-      <plugin id="org.eclipse.core.databinding.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.core.databinding.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.core.databinding.observable"/>
-      <plugin id="org.eclipse.core.databinding.observable.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.core.databinding.observable.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.core.databinding.property"/>
-      <plugin id="org.eclipse.core.databinding.property.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.core.databinding.property.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.core.expressions"/>
       <plugin id="org.eclipse.core.filebuffers"/>
-      <plugin id="org.eclipse.core.filebuffers.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.core.filebuffers.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.core.filesystem"/>
-      <plugin id="org.eclipse.core.filesystem.aix.ppc" fragment="true"/>
-      <plugin id="org.eclipse.core.filesystem.aix.ppc.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.core.filesystem.aix.ppc.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.core.filesystem.aix.ppc64" fragment="true"/>
-      <plugin id="org.eclipse.core.filesystem.aix.ppc64.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.core.filesystem.aix.ppc64.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.core.filesystem.hpux.ia64" fragment="true"/>
-      <plugin id="org.eclipse.core.filesystem.hpux.ia64.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.core.filesystem.hpux.ia64.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.core.filesystem.java7" fragment="true"/>
-      <plugin id="org.eclipse.core.filesystem.java7.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.core.filesystem.java7.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.core.filesystem.linux.ppc" fragment="true"/>
-      <plugin id="org.eclipse.core.filesystem.linux.ppc.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.core.filesystem.linux.ppc.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.core.filesystem.linux.ppc64" fragment="true"/>
-      <plugin id="org.eclipse.core.filesystem.linux.ppc64.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.core.filesystem.linux.ppc64.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.core.filesystem.linux.ppc64le" fragment="true"/>
-      <plugin id="org.eclipse.core.filesystem.linux.ppc64le.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.core.filesystem.linux.ppc64le.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.core.filesystem.linux.x86" fragment="true"/>
-      <plugin id="org.eclipse.core.filesystem.linux.x86.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.core.filesystem.linux.x86.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.core.filesystem.linux.x86_64" fragment="true"/>
-      <plugin id="org.eclipse.core.filesystem.linux.x86_64.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.core.filesystem.linux.x86_64.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.core.filesystem.macosx" fragment="true"/>
-      <plugin id="org.eclipse.core.filesystem.macosx.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.core.filesystem.macosx.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.core.filesystem.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.core.filesystem.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.core.filesystem.solaris.sparc" fragment="true"/>
-      <plugin id="org.eclipse.core.filesystem.solaris.sparc.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.core.filesystem.solaris.sparc.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.core.filesystem.win32.x86" fragment="true"/>
-      <plugin id="org.eclipse.core.filesystem.win32.x86.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.core.filesystem.win32.x86.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.core.filesystem.win32.x86_64" fragment="true"/>
-      <plugin id="org.eclipse.core.filesystem.win32.x86_64.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.core.filesystem.win32.x86_64.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.core.jobs"/>
       <plugin id="org.eclipse.core.net"/>
-      <plugin id="org.eclipse.core.net.linux.x86" fragment="true"/>
-      <plugin id="org.eclipse.core.net.linux.x86.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.core.net.linux.x86.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.core.net.linux.x86_64" fragment="true"/>
-      <plugin id="org.eclipse.core.net.linux.x86_64.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.core.net.linux.x86_64.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.core.net.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.core.net.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.core.net.win32.x86" fragment="true"/>
-      <plugin id="org.eclipse.core.net.win32.x86.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.core.net.win32.x86.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.core.net.win32.x86_64" fragment="true"/>
-      <plugin id="org.eclipse.core.net.win32.x86_64.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.core.net.win32.x86_64.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.core.resources"/>
-      <plugin id="org.eclipse.core.resources.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.core.resources.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.core.resources.win32.x86" fragment="true"/>
-      <plugin id="org.eclipse.core.resources.win32.x86_64" fragment="true"/>
       <plugin id="org.eclipse.core.runtime"/>
-      <plugin id="org.eclipse.core.runtime.compatibility.registry" fragment="true"/>
       <plugin id="org.eclipse.core.variables"/>
-      <plugin id="org.eclipse.core.variables.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.core.variables.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.e4.core.commands"/>
-      <plugin id="org.eclipse.e4.core.commands.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.e4.core.commands.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.e4.core.contexts"/>
       <plugin id="org.eclipse.e4.core.di"/>
+      <plugin id="org.eclipse.e4.core.di.annotations"/>
       <plugin id="org.eclipse.e4.core.di.extensions"/>
+      <plugin id="org.eclipse.e4.core.di.extensions.supplier"/>
       <plugin id="org.eclipse.e4.core.services"/>
+      <plugin id="org.eclipse.e4.emf.xpath"/>
       <plugin id="org.eclipse.e4.ui.bindings"/>
-      <plugin id="org.eclipse.e4.ui.bindings.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.e4.ui.bindings.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.e4.ui.css.core"/>
-      <plugin id="org.eclipse.e4.ui.css.core.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.e4.ui.css.core.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.e4.ui.css.swt"/>
-      <plugin id="org.eclipse.e4.ui.css.swt.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.e4.ui.css.swt.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.e4.ui.css.swt.theme"/>
-      <plugin id="org.eclipse.e4.ui.css.swt.theme.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.e4.ui.css.swt.theme.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.e4.ui.di"/>
-      <plugin id="org.eclipse.e4.ui.di.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.e4.ui.di.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.e4.ui.model.workbench"/>
-      <plugin id="org.eclipse.e4.ui.model.workbench.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.e4.ui.model.workbench.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.e4.ui.services"/>
-      <plugin id="org.eclipse.e4.ui.services.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.e4.ui.services.nl_ru" fragment="true"/>
+      <plugin id="org.eclipse.e4.ui.swt.gtk" fragment="true"/>
       <plugin id="org.eclipse.e4.ui.widgets"/>
-      <plugin id="org.eclipse.e4.ui.widgets.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.e4.ui.widgets.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.e4.ui.workbench"/>
       <plugin id="org.eclipse.e4.ui.workbench.addons.swt"/>
-      <plugin id="org.eclipse.e4.ui.workbench.addons.swt.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.e4.ui.workbench.addons.swt.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.e4.ui.workbench.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.e4.ui.workbench.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.e4.ui.workbench.renderers.swt"/>
       <plugin id="org.eclipse.e4.ui.workbench.renderers.swt.cocoa" fragment="true"/>
-      <plugin id="org.eclipse.e4.ui.workbench.renderers.swt.cocoa.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.e4.ui.workbench.renderers.swt.cocoa.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.e4.ui.workbench.renderers.swt.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.e4.ui.workbench.renderers.swt.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.e4.ui.workbench.swt"/>
-      <plugin id="org.eclipse.e4.ui.workbench.swt.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.e4.ui.workbench.swt.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.e4.ui.workbench3"/>
-      <plugin id="org.eclipse.e4.ui.workbench3.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.e4.ui.workbench3.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.ecf"/>
-      <plugin id="org.eclipse.ecf.filetransfer"/>
-      <plugin id="org.eclipse.ecf.identity"/>
-      <plugin id="org.eclipse.ecf.provider.filetransfer"/>
-      <plugin id="org.eclipse.ecf.provider.filetransfer.ssl" fragment="true"/>
-      <plugin id="org.eclipse.ecf.ssl" fragment="true"/>
       <plugin id="org.eclipse.emf.common"/>
       <plugin id="org.eclipse.emf.ecore"/>
       <plugin id="org.eclipse.emf.ecore.change"/>
@@ -285,265 +182,95 @@
       <plugin id="org.eclipse.equinox.app"/>
       <plugin id="org.eclipse.equinox.bidi"/>
       <plugin id="org.eclipse.equinox.common"/>
+      <plugin id="org.eclipse.equinox.console"/>
       <plugin id="org.eclipse.equinox.ds"/>
-      <plugin id="org.eclipse.equinox.event"/>
       <plugin id="org.eclipse.equinox.frameworkadmin"/>
       <plugin id="org.eclipse.equinox.frameworkadmin.equinox"/>
-      <plugin id="org.eclipse.equinox.frameworkadmin.equinox.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.equinox.frameworkadmin.equinox.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.equinox.frameworkadmin.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.equinox.frameworkadmin.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.equinox.p2.artifact.repository"/>
-      <plugin id="org.eclipse.equinox.p2.artifact.repository.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.equinox.p2.artifact.repository.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.equinox.p2.console"/>
-      <plugin id="org.eclipse.equinox.p2.console.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.equinox.p2.console.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.equinox.p2.core"/>
-      <plugin id="org.eclipse.equinox.p2.core.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.equinox.p2.core.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.equinox.p2.director"/>
-      <plugin id="org.eclipse.equinox.p2.director.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.equinox.p2.director.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.equinox.p2.discovery"/>
-      <plugin id="org.eclipse.equinox.p2.discovery.compatibility"/>
-      <plugin id="org.eclipse.equinox.p2.discovery.compatibility.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.equinox.p2.discovery.compatibility.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.equinox.p2.discovery.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.equinox.p2.discovery.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.equinox.p2.engine"/>
-      <plugin id="org.eclipse.equinox.p2.engine.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.equinox.p2.engine.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.equinox.p2.garbagecollector"/>
-      <plugin id="org.eclipse.equinox.p2.garbagecollector.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.equinox.p2.garbagecollector.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.equinox.p2.jarprocessor"/>
-      <plugin id="org.eclipse.equinox.p2.jarprocessor.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.equinox.p2.jarprocessor.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.equinox.p2.metadata"/>
-      <plugin id="org.eclipse.equinox.p2.metadata.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.equinox.p2.metadata.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.equinox.p2.metadata.repository"/>
-      <plugin id="org.eclipse.equinox.p2.metadata.repository.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.equinox.p2.metadata.repository.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.equinox.p2.operations"/>
-      <plugin id="org.eclipse.equinox.p2.operations.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.equinox.p2.operations.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.equinox.p2.publisher"/>
-      <plugin id="org.eclipse.equinox.p2.publisher.eclipse"/>
-      <plugin id="org.eclipse.equinox.p2.publisher.eclipse.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.equinox.p2.publisher.eclipse.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.equinox.p2.publisher.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.equinox.p2.publisher.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.equinox.p2.repository"/>
-      <plugin id="org.eclipse.equinox.p2.repository.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.equinox.p2.repository.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.equinox.p2.touchpoint.eclipse"/>
-      <plugin id="org.eclipse.equinox.p2.touchpoint.eclipse.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.equinox.p2.touchpoint.eclipse.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.equinox.p2.transport.ecf"/>
-      <plugin id="org.eclipse.equinox.p2.transport.ecf.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.equinox.p2.transport.ecf.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.equinox.p2.ui"/>
       <plugin id="org.eclipse.equinox.p2.ui.discovery"/>
-      <plugin id="org.eclipse.equinox.p2.ui.discovery.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.equinox.p2.ui.discovery.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.equinox.p2.ui.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.equinox.p2.ui.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.equinox.p2.ui.sdk"/>
-      <plugin id="org.eclipse.equinox.p2.ui.sdk.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.equinox.p2.ui.sdk.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.equinox.p2.ui.sdk.scheduler"/>
-      <plugin id="org.eclipse.equinox.p2.ui.sdk.scheduler.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.equinox.p2.ui.sdk.scheduler.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.equinox.p2.updatechecker"/>
-      <plugin id="org.eclipse.equinox.p2.updatechecker.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.equinox.p2.updatechecker.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.equinox.p2.updatesite"/>
-      <plugin id="org.eclipse.equinox.p2.updatesite.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.equinox.p2.updatesite.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.equinox.preferences"/>
+      <plugin id="org.eclipse.equinox.region" fragment="true"/>
       <plugin id="org.eclipse.equinox.registry"/>
       <plugin id="org.eclipse.equinox.security"/>
+      <plugin id="org.eclipse.equinox.security.linux.x86_64" fragment="true"/>
       <plugin id="org.eclipse.equinox.security.macosx" fragment="true"/>
       <plugin id="org.eclipse.equinox.security.ui"/>
       <plugin id="org.eclipse.equinox.security.win32.x86" fragment="true"/>
       <plugin id="org.eclipse.equinox.security.win32.x86_64" fragment="true"/>
       <plugin id="org.eclipse.equinox.simpleconfigurator"/>
       <plugin id="org.eclipse.equinox.simpleconfigurator.manipulator"/>
-      <plugin id="org.eclipse.equinox.simpleconfigurator.manipulator.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.equinox.simpleconfigurator.manipulator.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.equinox.simpleconfigurator.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.equinox.simpleconfigurator.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.equinox.util"/>
+      <plugin id="org.eclipse.equinox.transforms.hook" fragment="true"/>
+      <plugin id="org.eclipse.equinox.weaving.hook" fragment="true"/>
       <plugin id="org.eclipse.help"/>
-      <plugin id="org.eclipse.help.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.help.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.jface"/>
       <plugin id="org.eclipse.jface.databinding"/>
-      <plugin id="org.eclipse.jface.databinding.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.jface.databinding.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.jface.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.jface.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.jface.text"/>
-      <plugin id="org.eclipse.jface.text.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.jface.text.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.ltk.core.refactoring"/>
-      <plugin id="org.eclipse.ltk.core.refactoring.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.ltk.core.refactoring.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.ltk.ui.refactoring"/>
-      <plugin id="org.eclipse.ltk.ui.refactoring.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.ltk.ui.refactoring.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.osgi"/>
       <plugin id="org.eclipse.osgi.compatibility.state" fragment="true"/>
-      <plugin id="org.eclipse.osgi.compatibility.state.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.osgi.compatibility.state.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.osgi.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.osgi.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.osgi.services"/>
-      <plugin id="org.eclipse.osgi.services.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.osgi.services.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.osgi.util"/>
-      <plugin id="org.eclipse.osgi.util.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.osgi.util.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.persistence.asm"/>
-      <plugin id="org.eclipse.persistence.core"/>
-      <plugin id="org.eclipse.persistence.jpa"/>
-      <plugin id="org.eclipse.persistence.jpa.jpql"/>
-      <plugin id="org.eclipse.persistence.nosql" fragment="true"/>
-      <plugin id="org.eclipse.persistence.oracle" fragment="true"/>
-      <plugin id="org.eclipse.persistence.oracle.nosql" fragment="true"/>
+      <plugin id="org.eclipse.pde.ds.lib"/>
       <plugin id="org.eclipse.platform"/>
-      <plugin id="org.eclipse.platform.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.platform.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.swt"/>
-      <plugin id="org.eclipse.swt.carbon.macosx.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.swt.carbon.macosx.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.swt.cocoa.macosx" fragment="true"/>
-      <plugin id="org.eclipse.swt.cocoa.macosx.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.swt.cocoa.macosx.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.swt.cocoa.macosx.x86_64" fragment="true"/>
-      <plugin id="org.eclipse.swt.cocoa.macosx.x86_64.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.swt.cocoa.macosx.x86_64.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.swt.gtk.aix.ppc" fragment="true"/>
-      <plugin id="org.eclipse.swt.gtk.aix.ppc.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.swt.gtk.aix.ppc.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.swt.gtk.aix.ppc64" fragment="true"/>
-      <plugin id="org.eclipse.swt.gtk.aix.ppc64.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.swt.gtk.aix.ppc64.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.swt.gtk.hpux.ia64" fragment="true"/>
-      <plugin id="org.eclipse.swt.gtk.hpux.ia64.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.swt.gtk.hpux.ia64.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.swt.gtk.hpux.ia64_32.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.swt.gtk.hpux.ia64_32.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.swt.gtk.linux.ppc" fragment="true"/>
-      <plugin id="org.eclipse.swt.gtk.linux.ppc.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.swt.gtk.linux.ppc.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.swt.gtk.linux.ppc64" fragment="true"/>
-      <plugin id="org.eclipse.swt.gtk.linux.ppc64.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.swt.gtk.linux.ppc64.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.swt.gtk.linux.ppc64le" fragment="true"/>
-      <plugin id="org.eclipse.swt.gtk.linux.ppc64le.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.swt.gtk.linux.ppc64le.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.swt.gtk.linux.s390" fragment="true"/>
-      <plugin id="org.eclipse.swt.gtk.linux.s390.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.swt.gtk.linux.s390.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.swt.gtk.linux.s390x" fragment="true"/>
-      <plugin id="org.eclipse.swt.gtk.linux.s390x.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.swt.gtk.linux.s390x.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.swt.gtk.linux.x86" fragment="true"/>
-      <plugin id="org.eclipse.swt.gtk.linux.x86.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.swt.gtk.linux.x86.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.swt.gtk.linux.x86_64" fragment="true"/>
-      <plugin id="org.eclipse.swt.gtk.linux.x86_64.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.swt.gtk.linux.x86_64.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.swt.gtk.solaris.sparc" fragment="true"/>
-      <plugin id="org.eclipse.swt.gtk.solaris.sparc.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.swt.gtk.solaris.sparc.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.swt.gtk.solaris.x86" fragment="true"/>
-      <plugin id="org.eclipse.swt.gtk.solaris.x86.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.swt.gtk.solaris.x86.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.swt.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.swt.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.swt.win32.win32.x86" fragment="true"/>
-      <plugin id="org.eclipse.swt.win32.win32.x86.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.swt.win32.win32.x86.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.swt.win32.win32.x86_64" fragment="true"/>
-      <plugin id="org.eclipse.swt.win32.win32.x86_64.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.swt.win32.win32.x86_64.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.team.core"/>
-      <plugin id="org.eclipse.team.core.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.team.core.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.team.ui"/>
-      <plugin id="org.eclipse.team.ui.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.team.ui.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.text"/>
-      <plugin id="org.eclipse.text.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.text.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.ui"/>
       <plugin id="org.eclipse.ui.browser"/>
-      <plugin id="org.eclipse.ui.browser.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.ui.browser.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.ui.cocoa" fragment="true"/>
-      <plugin id="org.eclipse.ui.cocoa.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.ui.cocoa.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.ui.console"/>
-      <plugin id="org.eclipse.ui.console.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.ui.console.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.ui.editors"/>
-      <plugin id="org.eclipse.ui.editors.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.ui.editors.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.ui.forms"/>
-      <plugin id="org.eclipse.ui.forms.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.ui.forms.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.ui.ide"/>
-      <plugin id="org.eclipse.ui.ide.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.ui.ide.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.ui.intro"/>
-      <plugin id="org.eclipse.ui.intro.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.ui.intro.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.ui.navigator"/>
-      <plugin id="org.eclipse.ui.navigator.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.ui.navigator.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.ui.navigator.resources"/>
-      <plugin id="org.eclipse.ui.navigator.resources.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.ui.navigator.resources.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.ui.net"/>
-      <plugin id="org.eclipse.ui.net.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.ui.net.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.ui.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.ui.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.ui.themes"/>
-      <plugin id="org.eclipse.ui.themes.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.ui.themes.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.ui.views"/>
-      <plugin id="org.eclipse.ui.views.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.ui.views.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.ui.views.properties.tabbed"/>
-      <plugin id="org.eclipse.ui.views.properties.tabbed.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.ui.views.properties.tabbed.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.ui.win32" fragment="true"/>
-      <plugin id="org.eclipse.ui.win32.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.ui.win32.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.ui.workbench"/>
-      <plugin id="org.eclipse.ui.workbench.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.ui.workbench.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.ui.workbench.texteditor"/>
-      <plugin id="org.eclipse.ui.workbench.texteditor.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.ui.workbench.texteditor.nl_ru" fragment="true"/>
-      <plugin id="org.eclipse.update.configurator"/>
-      <plugin id="org.eclipse.update.configurator.nl_fr" fragment="true"/>
-      <plugin id="org.eclipse.update.configurator.nl_ru" fragment="true"/>
       <plugin id="org.sat4j.core"/>
       <plugin id="org.sat4j.pb"/>
+      <plugin id="org.tukaani.xz"/>
       <plugin id="org.txm.core"/>
+      <plugin id="org.txm.libs.args4j"/>
+      <plugin id="org.txm.libs.batik"/>
+      <plugin id="org.txm.libs.colt"/>
+      <plugin id="org.txm.libs.cqp"/>
+      <plugin id="org.txm.libs.cqp.linux" fragment="true"/>
+      <plugin id="org.txm.libs.cqp.macosx" fragment="true"/>
+      <plugin id="org.txm.libs.cqp.win32" fragment="true"/>
       <plugin id="org.txm.libs.groovy-all"/>
-      <plugin id="org.txm.libs.jfreechart"/>
+      <plugin id="org.txm.libs.itext"/>
+      <plugin id="org.txm.libs.rserve"/>
+      <plugin id="org.txm.libs.saxon"/>
       <plugin id="org.txm.rcp"/>
+      <plugin id="org.txm.searchengine.core"/>
+      <plugin id="org.txm.searchengine.cqp.core"/>
+      <plugin id="org.txm.statsengine.core"/>
+      <plugin id="org.txm.statsengine.r.core"/>
+      <plugin id="org.txm.statsengine.r.core.linux" fragment="true"/>
+      <plugin id="org.txm.statsengine.r.core.macosx" fragment="true"/>
+      <plugin id="org.txm.statsengine.r.core.win32" fragment="true"/>
+      <plugin id="org.txm.tokenizer.core"/>
+      <plugin id="org.txm.utils"/>
       <plugin id="org.w3c.css.sac"/>
-      <plugin id="org.w3c.dom.events"/>
-      <plugin id="org.w3c.dom.smil"/>
-      <plugin id="org.w3c.dom.svg"/>
    </plugins>
 
    <features>
@@ -553,8 +280,6 @@
       <feature id="org.eclipse.equinox.p2.core.feature"/>
       <feature id="org.eclipse.ecf.core.ssl.feature"/>
       <feature id="org.eclipse.rcp"/>
-      <feature id="org.eclipse.babel.nls_eclipse_ru"/>
-      <feature id="org.eclipse.babel.nls_eclipse_fr"/>
       <feature id="org.eclipse.ecf.core.feature"/>
       <feature id="org.eclipse.emf.ecore"/>
       <feature id="org.eclipse.e4.rcp"/>
@@ -586,12 +311,7 @@
    </features>
 
    <configurations>
-      <plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="0" />
-      <plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" />
-      <plugin id="org.eclipse.equinox.ds" autoStart="true" startLevel="2" />
-      <plugin id="org.eclipse.equinox.event" autoStart="true" startLevel="2" />
       <plugin id="org.eclipse.equinox.p2.reconciler.dropins" autoStart="true" startLevel="0" />
-      <plugin id="org.eclipse.equinox.simpleconfigurator" autoStart="true" startLevel="1" />
       <plugin id="org.txm.groovy.rcp" autoStart="false" startLevel="2" />
    </configurations>
 
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/BaseAbstractHandler.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/BaseAbstractHandler.java	(revision 880)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/BaseAbstractHandler.java	(revision 881)
@@ -21,13 +21,13 @@
 import org.eclipse.ui.contexts.IContextService;
 import org.eclipse.ui.handlers.HandlerUtil;
 import org.eclipse.ui.handlers.IHandlerService;
+import org.txm.Toolbox;
+import org.txm.core.engines.EngineType;
 import org.txm.core.preferences.TXMPreferences;
 import org.txm.core.results.TXMResult;
 import org.txm.rcp.editors.TXMEditor;
 import org.txm.rcp.views.corpora.CorporaView;
 import org.txm.searchengine.cqp.CQPSearchEngine;
-import org.txm.statsengine.r.core.RStatsEngine;
-import org.txm.statsengine.r.core.messages.RCoreMessages;
 import org.txm.utils.logger.Log;
 
 /**
@@ -57,12 +57,13 @@
 	 * @return true if the stat engine is available
 	 */
 	public boolean checkStatsEngine()	{
-		if (!RStatsEngine.isStarted()) {
-			System.out.println(RCoreMessages.error_statsEngineNotReadyCancelingCommand);
-			Log.severe(RCoreMessages.error_statsEngineNotReadyCancelingCommand);
-			return false;
-		}
-		return true;
+		return Toolbox.getEngineManager(EngineType.STATS).isCurrentEngineAvailable();
+//		if (!RStatsEngine.isStarted()) {
+//			System.out.println(RCoreMessages.error_statsEngineNotReadyCancelingCommand);
+//			Log.severe(RCoreMessages.error_statsEngineNotReadyCancelingCommand);
+//			return false;
+//		}
+//		return true;
 	}
 	
 	
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/testers/ToolboxTester.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/testers/ToolboxTester.java	(revision 880)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/testers/ToolboxTester.java	(revision 881)
@@ -27,7 +27,7 @@
 			Object expectedValue) {
 		if (PROPERTY_STATE_ENGINE_READY.equals(property)) {
 			//System.out.println("TEST: "+property+" = "+Toolbox.getEngineManager(EngineType.STAT).getEngine("R").getState()); //$NON-NLS-1$ //$NON-NLS-2$
-			return Toolbox.getEngineManager(EngineType.STATS).getEngine("R").getState();
+			return Toolbox.getEngineManager(EngineType.STATS).getEngine("R").isRunning();
 		} else if (PROPERTY_SEARCH_ENGINE_READY.equals(property)) {
 			System.out.println("TEST: "+property+" = "+CQPSearchEngine.isInitialized()); //$NON-NLS-1$ //$NON-NLS-2$
 			return CQPSearchEngine.isInitialized();
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/debug/TXMResultDebugView.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/debug/TXMResultDebugView.java	(revision 880)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/debug/TXMResultDebugView.java	(revision 881)
@@ -36,15 +36,16 @@
 import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.part.ViewPart;
-import org.txm.chartsengine.core.results.ChartResult;
+//import org.txm.chartsengine.core.results.ChartResult;
 import org.txm.core.results.TXMResult;
 import org.txm.rcp.views.corpora.CorporaView;
+//import org.txm.searchengine.cqp.corpus.Corpus;
 import org.txm.searchengine.cqp.corpus.Corpus;
 
 
 /**
  * Debug view for TXMResult.
- * 
+ * TODO make a chart result debug view/ext point to show more informations about charts
  * @author sjacquot
  */
 public class TXMResultDebugView extends ViewPart implements ISelectionChangedListener {
@@ -110,9 +111,9 @@
 		buffer.append("toString(): " + this.currentResult.toString() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
 		buffer.append("Details: " + this.currentResult.getDetails() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
 		buffer.append("Dirty: " + this.currentResult.isDirty() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
-		if (this.currentResult instanceof ChartResult) 	{
-			buffer.append("Chart dirty: " + ((ChartResult)this.currentResult).isChartDirty() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
-		}
+//		if (this.currentResult instanceof ChartResult) 	{
+//			buffer.append("Chart dirty: " + ((ChartResult)this.currentResult).isChartDirty() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
+//		}
 		
 		// Object parameters
 		buffer.append("\n"); //$NON-NLS-1$
@@ -128,15 +129,14 @@
 		buffer.append("Selected object = " + this.currentResult + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
 		buffer.append("Node visible = " + this.currentResult.isVisible() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
 		buffer.append("Node weight = " + this.currentResult.getWeight() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
-		if (this.currentResult instanceof ChartResult) 	{
-			buffer.append("Chart engine = " + ((ChartResult)this.currentResult).getChartsEngine() + ", chart object = " + ((ChartResult)this.currentResult).getChart()
-					+ ", chart type = " + ((ChartResult)this.currentResult).getChartType()
-					+ "\n");
-		}
+//		if (this.currentResult instanceof ChartResult) 	{
+//			buffer.append("Chart engine = " + ((ChartResult)this.currentResult).getChartsEngine() + ", chart object = " + ((ChartResult)this.currentResult).getChart()
+//					+ ", chart type = " + ((ChartResult)this.currentResult).getChartType()
+//					+ "\n");
+//		}
 		buffer.append("Selection full path name = " + this.currentResult.getFullPathSimpleName() + " - " + this.currentResult.getName() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 		buffer.append("Direct children count = " + this.currentResult.getChildren().size() + ", direct visible children count = " + this.currentResult.getChildren(true).size() + ", children count = " + this.currentResult.getDeepChildren().size() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-		buffer.append("Root parent = " + this.currentResult.getRootParent() + ", main corpus parent = " + Corpus.getParentMainCorpus(this.currentResult) + ", first parent corpus = " + Corpus.getFirstParentCorpus(this.currentResult)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-		
+		buffer.append("Root parent = " + this.currentResult.getRootParent() + ", main corpus parent = " + Corpus.getParentMainCorpus(this.currentResult) + ", first parent corpus = " + Corpus.getFirstParentCorpus(this.currentResult)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$		
 		displayArea.setText(buffer.toString());
 	}
 	
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/function/ComputeIntersection.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/function/ComputeIntersection.java	(revision 880)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/function/ComputeIntersection.java	(revision 881)
@@ -1,101 +0,0 @@
-package org.txm.rcp.commands.function;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.IHandlerListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.txm.Toolbox;
-import org.txm.searchengine.cqp.AbstractCqiClient;
-import org.txm.searchengine.cqp.CQPSearchEngine;
-import org.txm.searchengine.cqp.corpus.Corpus;
-import org.txm.searchengine.cqp.corpus.CqpObject;
-import org.txm.searchengine.cqp.corpus.MainCorpus;
-import org.txm.searchengine.cqp.corpus.Subcorpus;
-
-public class ComputeIntersection extends AbstractHandler {
-
-	@Override
-	public void addHandlerListener(IHandlerListener handlerListener) {
-		super.addHandlerListener(handlerListener);
-	}
-
-	@Override
-	public void dispose() {
-		super.dispose();
-	}
-
-
-	@Override
-	public Object execute(ExecutionEvent event) throws ExecutionException {
-		ISelection isel = HandlerUtil.getCurrentSelection(event);
-		if (!(isel instanceof IStructuredSelection)) return null;
-		IStructuredSelection selection = (IStructuredSelection) isel;
-		List list = selection.toList();
-		ArrayList<Subcorpus> subcorpora = new ArrayList<Subcorpus>();
-		for (Object o : list) if (o instanceof Subcorpus) subcorpora.add((Subcorpus) o);
-
-		if (subcorpora.size() != 2) {
-			System.out.println("Error: selection size != 2 : "+subcorpora.size());
-			return null;
-		}
-
-		HashSet<MainCorpus> set = new HashSet<MainCorpus>();
-		for (Subcorpus s : subcorpora) set.add(s.getMainCorpus());
-		if (set.size() > 1) {
-			System.out.println("Error: selected subcorpus have different main corpus: "+set);
-			return null;
-		}
-
-		MainCorpus ancestor = subcorpora.get(0).getMainCorpus();
-		String id1 = subcorpora.get(0).getQualifiedCqpId();
-		String id2 = subcorpora.get(1).getQualifiedCqpId();
-		String cqpid = CqpObject.subcorpusNamePrefix + Corpus.getNextSubcorpusCounter();
-		String command = "inter";
-		AbstractCqiClient CQI = CQPSearchEngine.getCqiClient();
-
-		//TODO: finish the command
-		
-//		String query = cqpid+"="+command+" "+id1+" "+id2+";";
-//		try {
-//			CQI.query(query)
-//		} catch (Exception e) {
-//			println "Error: "+CQI.getLastError()+". Please restart TXM."
-//			return;
-//		}
-//
-//		Subcorpus subcorpus = new Subcorpus(cqpid, name, ancestor, new Query("$command $id1 $id2;"));
-//
-//		println "$subcorpus stored in $ancestor"
-//
-//		monitor.syncExec(new Runnable() {
-//			public void run() {
-//				CorporaView.refresh();
-//				CorporaView.expand(subcorpus.getParent());
-//			}
-//		});
-
-		return null;
-	}
-
-	@Override
-	public boolean isEnabled() {
-		return super.isEnabled();
-	}
-
-	@Override
-	public boolean isHandled() {
-		return super.isHandled();
-	}
-
-	@Override
-	public void removeHandlerListener(IHandlerListener handlerListener) {
-		super.removeHandlerListener(handlerListener);
-	}
-}
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMBrowser.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMBrowser.java	(revision 880)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMBrowser.java	(revision 881)
@@ -57,7 +57,6 @@
 import org.txm.rcp.IImageKeys;
 import org.txm.rcp.StatusLine;
 import org.txm.rcp.messages.TXMUIMessages;
-import org.txm.searchengine.cqp.corpus.Corpus;
 
 /**
  * Call the internal browser of RCP specialized for TXM editions. 
@@ -86,7 +85,6 @@
 	
 	/** The source. */
 	private Object source;
-	private Corpus corpus;
 
 	/**
 	 * Instantiates a new txm browser.
@@ -251,7 +249,7 @@
 	public void lastPage() {
 		// System.out.println(Messages.TxmBrowser_2+currentPage);
 
-		if (currentPage != null && currentPage.getFile().equals(edition.getLastPage()))
+		if (currentPage != null && currentPage.getFile().equals(edition.getLastPage().getFile()))
 			return;
 		currentPage = edition.getLastPage();
 		this.webBrowser.setURL(currentPage.toURL());
@@ -662,12 +660,4 @@
 	public Page getCurrentPage() {
 		return currentPage;
 	}
-
-	public Corpus getCorpus() {
-		return corpus;
-	}
-	
-	public void setCorpus(Corpus corpus) {
-		this.corpus = corpus;
-	}
 }
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java	(revision 880)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java	(revision 881)
@@ -215,7 +215,7 @@
 		IPartListener2 pl = new IPartListener2() {
 			// ... Other methods
 			public void partClosed(IWorkbenchPartReference partRef) {
-				if (partRef.getId().equals(TXMEditor.this.getClass())) { // called after this.doSave() 
+				if (partRef.getId().equals(TXMEditor.this.getClass().getName())) { // called after this.doSave() 
 					//System.out.println("EVENT partClosed");
 					for (TXMEditorExtension<T> b : extensions) {
 						try {
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/SVGGraphicEditor.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/SVGGraphicEditor.java	(revision 880)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/SVGGraphicEditor.java	(revision 881)
@@ -38,7 +38,8 @@
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorSite;
 import org.eclipse.ui.PartInitException;
-import org.txm.chartsengine.core.results.ChartResult;
+import org.txm.core.results.TXMResult;
+//import org.txm.chartsengine.core.results.ChartResult;
 import org.txm.rcp.messages.TXMUIMessages;
 import org.txm.rcp.svg.SVGComposite;
 
@@ -48,7 +49,7 @@
  *
  * @author Sylvain Loiseau
  */
-public abstract class SVGGraphicEditor extends TXMEditor<ChartResult> {
+public abstract class SVGGraphicEditor extends TXMEditor<TXMResult> {
 
 	/** Linking with the OutlineView. */
 	// private OverviewOutlinePage overviewOutlinePage;
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/Application.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/Application.java	(revision 880)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/Application.java	(revision 881)
@@ -27,41 +27,23 @@
 //
 package org.txm.rcp;
 
-import java.io.File;
-import java.io.IOException;
 import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
 import java.util.logging.Level;
 
-import org.apache.commons.cli.CommandLine;
-import org.apache.commons.cli.GnuParser;
-import org.apache.commons.cli.OptionBuilder;
-import org.apache.commons.cli.Options;
-import org.apache.commons.cli.ParseException;
-import org.apache.commons.cli.Parser;
-import org.apache.commons.lang.StringUtils;
 import org.eclipse.core.net.proxy.IProxyService;
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.equinox.app.IApplication;
 import org.eclipse.equinox.app.IApplicationContext;
 import org.eclipse.jface.util.Util;
-import org.eclipse.osgi.util.NLS;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.preferences.ScopedPreferenceStore;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.ServiceReference;
 import org.txm.Toolbox;
 import org.txm.core.preferences.TBXPreferences;
-import org.txm.core.preferences.TXMPreferences;
-import org.txm.libs.cqp.CQPLibPreferences;
-import org.txm.objects.Workspace;
 import org.txm.rcp.messages.TXMUIMessages;
-import org.txm.searchengine.cqp.CQPPreferences;
-import org.txm.statsengine.r.core.preferences.RPreferences;
-import org.txm.utils.BundleUtils;
-import org.txm.utils.DeleteDir;
 import org.txm.utils.logger.Log;
 
 // TODO: Auto-generated Javadoc
@@ -247,60 +229,60 @@
 		}	
 	}
 
-	/**
-	 * Parses the command line.
-	 *
-	 * @return true, if successful
-	 * @deprecated, parse the command line the list optionsForPreferences must
-	 * be edited too add options
-	 */
-	private boolean parseCommandLine() {
-		boolean exit = false;
-		String[] optionsForPreferences = {
-				CQPLibPreferences.CQI_SERVER_PATH_TO_EXECUTABLE,
-				CQPLibPreferences.CQI_SERVER_PATH_TO_INIT_FILE,
-				//				TBXPreferences.CQI_SERVER_PATH_TO_REGISTRY,
-				RPreferences.PATH_TO_EXECUTABLE,
-				TBXPreferences.INSTALL_DIR };
-		String setPrefAndExit = "setPrefAndExit"; //$NON-NLS-1$
-
-		Options options = new Options();
-		options.addOption(OptionBuilder.create("product")); //option passed here when run as an eclipse application. Recognized to prevent a UnrecognizedOptionException //$NON-NLS-1$
-		options.addOption(OptionBuilder.create(setPrefAndExit));
-		for (String preference : optionsForPreferences)
-			options.addOption(OptionBuilder.withValueSeparator().hasArgs()
-					.create(preference));
-
-		Parser parser = new GnuParser();
-		CommandLine cl;
-		try {
-			cl = parser.parse(options, Platform.getCommandLineArgs());
-		} catch (ParseException e) {
-
-			System.err.println(NLS.bind(TXMUIMessages.FAILED_TO_PARSE_OPTIONS,
-					StringUtils.join(Platform.getCommandLineArgs(), " "), e)); //$NON-NLS-1$
-			org.txm.rcp.utils.Logger.printStackTrace(e);
-			exit = true;
-			return exit;
-		}
-
-		ScopedPreferenceStore preferences = new ScopedPreferenceStore(
-				org.eclipse.core.runtime.preferences.InstanceScope.INSTANCE, Application.PLUGIN_ID);
-		for (String preference : optionsForPreferences)
-			if (cl.hasOption(preference)) {
-				preferences.setValue(preference, cl.getOptionValue(preference));
-			}
-
-		try {
-			preferences.save();
-		} catch (IOException e) {
-			System.err.println(NLS.bind(TXMUIMessages.FAILED_TO_SAVE_PREFERENCES, e));
-			exit = true;
-			return exit;
-		}
-
-		if (cl.hasOption(setPrefAndExit))
-			exit = true;
-		return exit;
-	}
+//	/**
+//	 * Parses the command line.
+//	 *
+//	 * @return true, if successful
+//	 * @deprecated, parse the command line the list optionsForPreferences must
+//	 * be edited too add options
+//	 */
+//	private boolean parseCommandLine() {
+//		boolean exit = false;
+//		String[] optionsForPreferences = {
+//				CQPLibPreferences.CQI_SERVER_PATH_TO_EXECUTABLE,
+//				CQPLibPreferences.CQI_SERVER_PATH_TO_INIT_FILE,
+//				//				TBXPreferences.CQI_SERVER_PATH_TO_REGISTRY,
+//				RPreferences.PATH_TO_EXECUTABLE,
+//				TBXPreferences.INSTALL_DIR };
+//		String setPrefAndExit = "setPrefAndExit"; //$NON-NLS-1$
+//
+//		Options options = new Options();
+//		options.addOption(OptionBuilder.create("product")); //option passed here when run as an eclipse application. Recognized to prevent a UnrecognizedOptionException //$NON-NLS-1$
+//		options.addOption(OptionBuilder.create(setPrefAndExit));
+//		for (String preference : optionsForPreferences)
+//			options.addOption(OptionBuilder.withValueSeparator().hasArgs()
+//					.create(preference));
+//
+//		Parser parser = new GnuParser();
+//		CommandLine cl;
+//		try {
+//			cl = parser.parse(options, Platform.getCommandLineArgs());
+//		} catch (ParseException e) {
+//
+//			System.err.println(NLS.bind(TXMUIMessages.FAILED_TO_PARSE_OPTIONS,
+//					StringUtils.join(Platform.getCommandLineArgs(), " "), e)); //$NON-NLS-1$
+//			org.txm.rcp.utils.Logger.printStackTrace(e);
+//			exit = true;
+//			return exit;
+//		}
+//
+//		ScopedPreferenceStore preferences = new ScopedPreferenceStore(
+//				org.eclipse.core.runtime.preferences.InstanceScope.INSTANCE, Application.PLUGIN_ID);
+//		for (String preference : optionsForPreferences)
+//			if (cl.hasOption(preference)) {
+//				preferences.setValue(preference, cl.getOptionValue(preference));
+//			}
+//
+//		try {
+//			preferences.save();
+//		} catch (IOException e) {
+//			System.err.println(NLS.bind(TXMUIMessages.FAILED_TO_SAVE_PREFERENCES, e));
+//			exit = true;
+//			return exit;
+//		}
+//
+//		if (cl.hasOption(setPrefAndExit))
+//			exit = true;
+//		return exit;
+//	}
 }
Index: tmp/org.txm.rcp/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.rcp/META-INF/MANIFEST.MF	(revision 880)
+++ tmp/org.txm.rcp/META-INF/MANIFEST.MF	(revision 881)
@@ -1,6 +1,5 @@
 Manifest-Version: 1.0
 Require-Bundle: org.eclipse.ui;visibility:=reexport,
- org.eclipse.core.runtime;visibility:=reexport,
  org.eclipse.core.filesystem;bundle-version="1.2.0";visibility:=reexport,
  org.eclipse.ui.ide;visibility:=reexport,
  org.eclipse.ui.console;bundle-version="3.4.0";visibility:=reexport,
@@ -8,61 +7,32 @@
  org.eclipse.ui.browser;bundle-version="3.2.300";visibility:=reexport,
  org.eclipse.ui.forms;visibility:=reexport,
  org.eclipse.ui.editors;visibility:=reexport,
- org.txm.core;visibility:=reexport,
- org.eclipse.e4.ui.workbench.addons.swt;bundle-version="1.0.0";visibility:=reexport,
- org.eclipse.equinox.ds;bundle-version="1.4.100";visibility:=reexport,
- org.eclipse.equinox.event;bundle-version="1.3.0";visibility:=reexport,
  org.eclipse.equinox.p2.ui;bundle-version="2.3.0";visibility:=reexport,
  org.eclipse.equinox.p2.ui.sdk;bundle-version="1.0.300";visibility:=reexport,
  org.eclipse.equinox.p2.ui.sdk.scheduler;bundle-version="1.2.0";visibility:=reexport,
- org.eclipse.update.configurator;bundle-version="3.3.200";visibility:=reexport,
  org.eclipse.e4.ui.css.swt.theme;bundle-version="0.9.100";visibility:=reexport,
- org.eclipse.e4.ui.css.swt;bundle-version="0.11.0";visibility:=reexport,
- org.eclipse.e4.ui.css.core;bundle-version="0.10.100";visibility:=reexport,
- org.eclipse.equinox.p2.updatesite;bundle-version="1.0.400";visibility:=reexport,
- org.eclipse.platform;bundle-version="4.3.0";visibility:=reexport,
- org.eclipse.equinox.util;bundle-version="1.0.500";visibility:=reexport,
  org.eclipse.equinox.p2.operations;visibility:=reexport,
  org.eclipse.equinox.p2.metadata;bundle-version="2.2.0";visibility:=reexport,
- org.eclipse.equinox.p2.director;visibility:=reexport,
  org.eclipse.equinox.p2.ui.discovery;bundle-version="1.0.0";visibility:=reexport,
  org.eclipse.equinox.p2.discovery;bundle-version="1.0.200";visibility:=reexport,
- org.eclipse.equinox.p2.discovery.compatibility;bundle-version="1.0.101";visibility:=reexport,
- org.eclipse.swt;visibility:=reexport,
  org.eclipse.equinox.p2.repository;bundle-version="2.3.0";visibility:=reexport,
  org.eclipse.equinox.p2.core;bundle-version="2.3.0";visibility:=reexport,
  org.eclipse.equinox.p2.engine;bundle-version="2.3.0";visibility:=reexport,
- org.eclipse.equinox.p2.console;bundle-version="1.0.300";visibility:=reexport,
- org.eclipse.ui.net;bundle-version="1.2.200";visibility:=reexport,
- org.eclipse.core.net;visibility:=reexport,
  org.eclipse.e4.ui.model.workbench;visibility:=reexport,
  org.eclipse.e4.ui.workbench;bundle-version="1.0.0";visibility:=reexport,
- org.eclipse.e4.core.contexts;bundle-version="1.3.0";visibility:=reexport,
  org.eclipse.core.expressions;visibility:=reexport,
- org.eclipse.ui.navigator;bundle-version="3.5.300";visibility:=reexport,
- org.eclipse.ui.navigator.resources;bundle-version="3.4.500";visibility:=reexport,
- org.eclipse.e4.ui.di;visibility:=reexport,
- org.eclipse.ui.themes;bundle-version="1.0.1";visibility:=reexport,
- org.eclipse.core.resources;bundle-version="3.9.1";visibility:=reexport,
- org.eclipse.ui.workbench.texteditor;bundle-version="3.9.0";visibility:=reexport,
- org.eclipse.e4.ui.bindings;bundle-version="0.10.200";visibility:=reexport,
- org.eclipse.osgi.services;bundle-version="3.4.0";visibility:=reexport,
- org.eclipse.osgi.util;bundle-version="3.3.0";visibility:=reexport,
- org.eclipse.equinox.p2.reconciler.dropins;bundle-version="1.1.200";visibility:=reexport,
- org.txm.utils;bundle-version="1.0.0";visibility:=reexport,
+ org.eclipse.e4.core.contexts;bundle-version="1.6.0";visibility:=reexport,
+ org.eclipse.osgi;bundle-version="3.12.100";visibility:=reexport,
+ org.eclipse.equinox.ds;bundle-version="1.5.0";visibility:=reexport,
+ org.eclipse.equinox.util;bundle-version="1.0.500";visibility:=reexport,
+ org.eclipse.equinox.event;bundle-version="1.4.0";visibility:=reexport,
+ org.txm.core;bundle-version="0.8.0";visibility:=reexport,
  org.txm.libs.batik;bundle-version="0.0.0";visibility:=reexport,
- org.eclipse.ui.views.log;bundle-version="1.0.500";visibility:=reexport,
- org.eclipse.ui.workbench;visibility:=reexport,
- org.txm.searchengine.cqp.core;visibility:=reexport,
+ org.txm.libs.args4j;bundle-version="1.0.0";visibility:=reexport,
+ org.txm.tokenizer.core;bundle-version="1.0.0";visibility:=reexport,
+ org.txm.groovy.core;bundle-version="1.0.0";visibility:=reexport,
  org.txm.chartsengine.core;bundle-version="1.0.0";visibility:=reexport,
- org.txm.chartsengine.jfreechart.core;bundle-version="1.0.0";visibility:=reexport,
- org.txm.chartsengine.r.core;bundle-version="1.0.0";visibility:=reexport,
- org.txm.specificities.core;bundle-version="1.0.0";visibility:=reexport,
- org.txm.statsengine.core;bundle-version="1.0.0";visibility:=reexport,
- org.txm.statsengine.r.core;bundle-version="1.0.0";visibility:=reexport,
- org.txm.searchengine.core;bundle-version="1.0.0";visibility:=reexport,
- org.txm.groovy.core;visibility:=reexport,
- org.eclipse.jface
+ org.txm.searchengine.cqp.core;bundle-version="1.1.0";visibility:=reexport
 Export-Package: junit.extensions,
  junit.framework,
  junit.runner,
@@ -150,6 +120,7 @@
  org.txm.rcp.swt.dialog,
  org.txm.rcp.swt.listeners,
  org.txm.rcp.swt.provider,
+ org.txm.rcp.swt.toolbar,
  org.txm.rcp.swt.widget,
  org.txm.rcp.swt.widget.parameters,
  org.txm.rcp.swt.widget.preferences,
@@ -173,4 +144,5 @@
 Bundle-Activator: org.txm.rcp.Activator
 Bundle-SymbolicName: org.txm.rcp;singleton:=true
 Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Import-Package: org.eclipse.equinox.p2.planner;version="2.0.0"
 
Index: tmp/org.txm.rcp/.settings/org.eclipse.pde.core.prefs
===================================================================
--- tmp/org.txm.rcp/.settings/org.eclipse.pde.core.prefs	(revision 880)
+++ tmp/org.txm.rcp/.settings/org.eclipse.pde.core.prefs	(revision 881)
@@ -1,2 +0,0 @@
-eclipse.preferences.version=1
-resolve.requirebundle=false
Index: tmp/org.txm.chartsengine.svgbatik.rcp/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.chartsengine.svgbatik.rcp/META-INF/MANIFEST.MF	(revision 880)
+++ tmp/org.txm.chartsengine.svgbatik.rcp/META-INF/MANIFEST.MF	(revision 881)
@@ -1,13 +1,5 @@
 Manifest-Version: 1.0
-Require-Bundle: org.txm.libs.batik;bundle-version="0.0.0";visibility:=
- reexport,org.txm.libs.itext;bundle-version="2.1.5";visibility:=reexpo
- rt,org.txm.chartsengine.core;bundle-version="1.0.0";visibility:=reexp
- ort,org.txm.chartsengine.rcp;bundle-version="1.0.0";visibility:=reexp
- ort,org.txm.utils;bundle-version="1.0.0";visibility:=reexport,org.ecl
- ipse.swt;bundle-version="3.103.2";visibility:=reexport,org.txm.core;b
- undle-version="0.7.0";visibility:=reexport,org.txm.rcp;bundle-version
- ="0.7.8";visibility:=reexport,org.eclipse.core.expressions;bundle-ver
- sion="3.4.600";visibility:=reexport
+Require-Bundle: org.txm.chartsengine.rcp;bundle-version="1.0.0";visibility:=reexport
 Export-Package: org.txm.chartsengine.svgbatik.rcp,org.txm.chartsengine
  .svgbatik.rcp.swing,org.txm.chartsengine.svgbatik.rcp.swt
 Bundle-Vendor: Textometrie.org
Index: tmp/org.txm.specificities.core/.classpath
===================================================================
--- tmp/org.txm.specificities.core/.classpath	(revision 880)
+++ tmp/org.txm.specificities.core/.classpath	(revision 881)
@@ -1,7 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
+		<accessrules>
+			<accessrule kind="accessible" pattern="**"/>
+		</accessrules>
+	</classpathentry>
 	<classpathentry kind="src" path="src"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
Index: tmp/org.txm.specificities.core/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.specificities.core/META-INF/MANIFEST.MF	(revision 880)
+++ tmp/org.txm.specificities.core/META-INF/MANIFEST.MF	(revision 881)
@@ -1,16 +1,6 @@
 Manifest-Version: 1.0
-Require-Bundle: org.txm.utils;bundle-version="1.0.0";visibility:=reexp
- ort,org.eclipse.osgi;bundle-version="3.10.2";visibility:=reexport,org
- .eclipse.core.runtime;bundle-version="3.10.0";visibility:=reexport,or
- g.txm.searchengine.cqp.core;bundle-version="1.1.0";visibility:=reexpo
- rt,org.txm.statsengine.r.core;visibility:=reexport,org.txm.lexicaltab
- le.core;bundle-version="1.0.0";visibility:=reexport,org.txm.statsengi
- ne.core;bundle-version="1.0.0";visibility:=reexport,org.txm.core;bund
- le-version="0.7.0";visibility:=reexport,org.txm.progression.core;bund
- le-version="1.0.0";visibility:=reexport,org.txm.chartsengine.core;bun
- dle-version="1.0.0";visibility:=reexport,org.txm.chartsengine.jfreech
- art.core;bundle-version="1.0.0";visibility:=reexport,org.txm.chartsen
- gine.r.core;bundle-version="1.0.0";visibility:=reexport
+Require-Bundle: org.txm.lexicaltable.core;bundle-version="1.0.0";visibility:=reexport,
+ org.txm.progression.core;bundle-version="1.0.0";visibility:=reexport
 Export-Package: org.txm.functions.contrasts,
  org.txm.specificities.core.chartsengine.jfreechart,
  org.txm.specificities.core.chartsengine.r,
