Index: tmp/org.txm.core/src/java/org/txm/importer/StaxIdentityParser.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/StaxIdentityParser.java	(revision 2980)
+++ tmp/org.txm.core/src/java/org/txm/importer/StaxIdentityParser.java	(revision 2981)
@@ -14,49 +14,53 @@
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.stream.XMLStreamWriter;
 
+import org.txm.utils.logger.Log;
+
 /**
  * XML Identity transformation. extends the processXYZ methods to do something
- * @deprecated use the  org.txm.xml.XMLProcessor instead. The XMLProcessor implements Hooks to manage XML Event or XML DOM while parsing
+ * 
+ * @deprecated use the org.txm.xml.XMLProcessor instead. The XMLProcessor implements Hooks to manage XML Event or XML DOM while parsing
  * @author mdecorde
  *
  */
+@Deprecated
 public class StaxIdentityParser {
-
+	
 	/** The input */
 	protected URL inputurl;
-
+	
 	protected InputStream inputData;
-
+	
 	protected XMLInputFactory factory;
-
+	
 	protected XMLStreamReader parser;
-
+	
 	/** The output. */
 	protected XMLOutputFactory outfactory = XMLOutputFactory.newInstance();
-
+	
 	protected BufferedOutputStream output;
-
+	
 	protected XMLStreamWriter writer;
-
+	
 	public static String TXMNS = "http://textometrie.org/1.0";
-
+	
 	public static String TXM = "txm";
-
+	
 	public static String TEINS = "http://www.tei-c.org/ns/1.0";
-
+	
 	public static String TEI = "tei";
-
+	
 	protected PersonalNamespaceContext Nscontext = new PersonalNamespaceContext();
-
+	
 	// protected StringBuilder currentXPath = new StringBuilder("/")
 	protected String localname;
-
+	
 	int processingXInclude = 0;
-
+	
 	public StaxIdentityParser(File infile) throws IOException, XMLStreamException {
 		this(infile.toURI().toURL());
 	}
-
+	
 	public StaxIdentityParser(URL inputurl) throws IOException, XMLStreamException {
 		this.inputurl = inputurl;
 		this.inputData = inputurl.openStream();
@@ -64,7 +68,7 @@
 		this.parser = factory.createXMLStreamReader(inputData);
 		
 	}
-
+	
 	/**
 	 * Helper method to get an attribute value
 	 * 
@@ -73,21 +77,21 @@
 	 */
 	public String getParserAttributeValue(String name) {
 		if (name == null) return null;
-
+		
 		int c = parser.getAttributeCount();
 		for (int i = 0; i < c; i++) {
 			if (name.equals(parser.getAttributeLocalName(i))) {
 				return parser.getAttributeValue(i);
 			}
 		}
-
+		
 		return null;
 	}
-
+	
 	protected void before() {
-
+		
 	}
-
+	
 	protected void after() throws XMLStreamException, IOException {
 		factory = null;
 		if (parser != null) parser.close();
@@ -97,28 +101,28 @@
 		writer = null;
 		parser = null;
 	}
-
+	
 	protected void closeForError() throws XMLStreamException, IOException {
 		if (parser != null) parser.close();
 		if (inputData != null) inputData.close();
 	}
-
+	
 	/**
 	 * Creates the output.
 	 *
 	 * @param outfile the outfile
 	 * @return true, if successful
 	 */
-	private boolean createOutput(File f) {
+	private boolean createOutput(File f, String encoding) {
 		try {
 			if (writer != null) // process from a file
 				writer.close();
 			if (output != null) // process from a file
 				output.close();
-
+			
 			output = new BufferedOutputStream(new FileOutputStream(f), 16 * 1024);
-
-			writer = outfactory.createXMLStreamWriter(output, "UTF-8");// create a new file
+			
+			writer = outfactory.createXMLStreamWriter(output, encoding);// create a new file
 			writer.setNamespaceContext(Nscontext);
 			return true;
 		}
@@ -127,15 +131,24 @@
 			return false;
 		}
 	}
-
+	
+	/**
+	 * Default output encoding is UTF-8
+	 * 
+	 * @param outfile
+	 * @return
+	 * @throws XMLStreamException
+	 * @throws IOException
+	 */
 	public boolean process(File outfile) throws XMLStreamException, IOException {
-		if (!createOutput(outfile))
-			return false;
-
-//		//writer.writeStartDocument("UTF-8", "1.0");
-//		writer.writeStartDocument();
-//		writer.writeCharacters("\n");
-		boolean ret = process(writer);
+		return process(outfile, "UTF-8");
+	}
+	
+	public boolean process(File outfile, String encoding) throws XMLStreamException, IOException {
+		// //writer.writeStartDocument("UTF-8", "1.0");
+		// writer.writeStartDocument();
+		// writer.writeCharacters("\n");
+		boolean ret = process(null, outfile, encoding);
 		if (writer != null) {
 			writer.close();
 		}
@@ -147,7 +160,7 @@
 				System.out.println("output excep: " + e);
 			}
 		}
-
+		
 		if (parser != null) {
 			try {
 				parser.close();
@@ -156,7 +169,7 @@
 				System.out.println("parser excep: " + e);
 			}
 		}
-
+		
 		if (inputData != null) {
 			try {
 				inputData.close();
@@ -165,66 +178,98 @@
 				System.out.println("inputData excep: " + e);
 			}
 		}
-
+		
 		return ret;
 	}
-
+	
 	public final static String SLASH = "/";
+	
 	public boolean firstElementStarted = false;
+	
+	
+	/**
+	 * If the writer is given, the expected encoding is UTF-8
+	 * 
+	 * @param awriter
+	 * @return
+	 * @throws XMLStreamException
+	 * @throws IOException
+	 */
 	public boolean process(XMLStreamWriter awriter) throws XMLStreamException, IOException {
-		
+		if (awriter == null) {
+			Log.warning("Error: called without XMLStreamWriter.");
+			return false;
+		}
+		return process(awriter, null, "UTF-8");
+	}
+	
+	
+	private boolean process(XMLStreamWriter awriter, File outfile, String encoding) throws XMLStreamException, IOException {
 		firstElementStarted = false;
 		this.writer = awriter;
+		
 		// if (processingXInclude == 0) {
 		before(); // if you need to do something before parsing the XML
 		// }
 		try {
 			for (int event = parser.getEventType(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
 				switch (event) {
-				case XMLStreamConstants.START_DOCUMENT:
-					writer.writeStartDocument(parser.getCharacterEncodingScheme(), parser.getVersion());
-					writer.writeCharacters("\n");
-					break;
-				case XMLStreamConstants.NAMESPACE:
-					this.Nscontext.addNamespace(parser.getPrefix(), parser.getNamespaceURI());
-					processNamespace();
-					break;
-				case XMLStreamConstants.START_ELEMENT:
-					firstElementStarted = true;
-					localname = parser.getLocalName();
-					// currentXPath.append(SLASH)
-					processStartElement();
-					break;
-				case XMLStreamConstants.NOTATION_DECLARATION:
-					break;
-				case XMLStreamConstants.SPACE:
-					break;
-				case XMLStreamConstants.CHARACTERS:
-					processCharacters();
-					break;
-				case XMLStreamConstants.END_ELEMENT:
-					localname = parser.getLocalName();
-					processEndElement();
-					// currentXPath.substring(0, currentXPath.length() - localname.length() -1)
-					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_DOCUMENT:
-					processEndDocument();
-					break;
-				case XMLStreamConstants.ENTITY_REFERENCE:
-					processEntityReference();
-					break;
+					case XMLStreamConstants.START_DOCUMENT:
+						if (encoding == null) { // if encoding is not specified,
+							encoding = parser.getCharacterEncodingScheme();
+						}
+						if (awriter == null) {
+							if (!createOutput(outfile, encoding)) {
+								return false;
+							}
+						}
+						else {
+							encoding = "UTF-8"; // if awriter is set encoding must be UTF-8
+						}
+						
+						writer.writeStartDocument(encoding, parser.getVersion());
+						writer.writeCharacters("\n");
+						break;
+					case XMLStreamConstants.NAMESPACE:
+						this.Nscontext.addNamespace(parser.getPrefix(), parser.getNamespaceURI());
+						processNamespace();
+						break;
+					case XMLStreamConstants.START_ELEMENT:
+						firstElementStarted = true;
+						localname = parser.getLocalName();
+						// currentXPath.append(SLASH)
+						processStartElement();
+						break;
+					case XMLStreamConstants.NOTATION_DECLARATION:
+						break;
+					case XMLStreamConstants.SPACE:
+						break;
+					case XMLStreamConstants.CHARACTERS:
+						processCharacters();
+						break;
+					case XMLStreamConstants.END_ELEMENT:
+						localname = parser.getLocalName();
+						processEndElement();
+						// currentXPath.substring(0, currentXPath.length() - localname.length() -1)
+						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_DOCUMENT:
+						processEndDocument();
+						break;
+					case XMLStreamConstants.ENTITY_REFERENCE:
+						processEntityReference();
+						break;
 				}
 			}
 		}
@@ -244,7 +289,7 @@
 		// }
 		return true;
 	}
-
+	
 	/**
 	 * The start element has already been written
 	 * 
@@ -259,44 +304,44 @@
 			for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
 				// System.out.println("event "+event
 				switch (event) {
-				case XMLStreamConstants.NAMESPACE:
-					processNamespace();
-					break;
-				case XMLStreamConstants.START_ELEMENT:
-					elements++;
-					localname = parser.getLocalName();
-					// currentXPath.append(SLASH)
-					_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:
-					elements--;
-					localname = parser.getLocalName();
-					// currentXPath.substring(0, currentXPath.length() - localname.length() -1)
-					writer.writeEndElement();
-					if (elements == 0 && localname == tagname)
-						return;
-					break;
-				case XMLStreamConstants.END_DOCUMENT:
-					processEndDocument();
-					break;
-				case XMLStreamConstants.ENTITY_REFERENCE:
-					processEntityReference();
-					break;
+					case XMLStreamConstants.NAMESPACE:
+						processNamespace();
+						break;
+					case XMLStreamConstants.START_ELEMENT:
+						elements++;
+						localname = parser.getLocalName();
+						// currentXPath.append(SLASH)
+						_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:
+						elements--;
+						localname = parser.getLocalName();
+						// currentXPath.substring(0, currentXPath.length() - localname.length() -1)
+						writer.writeEndElement();
+						if (elements == 0 && localname == tagname)
+							return;
+						break;
+					case XMLStreamConstants.END_DOCUMENT:
+						processEndDocument();
+						break;
+					case XMLStreamConstants.ENTITY_REFERENCE:
+						processEntityReference();
+						break;
 				}
 			}
 		}
@@ -309,21 +354,21 @@
 			return;
 		}
 	}
-
+	
 	public String getLocation() {
 		if (parser != null)
 			return "Line: " + parser.getLocation().getLineNumber() + " Col: " + parser.getLocation().getColumnNumber();
 		return null;
 	}
-
+	
 	protected void processNamespace() throws XMLStreamException {
 		writer.writeNamespace(parser.getPrefix(), parser.getNamespaceURI());
 	}
-
+	
 	public static final String INCLUDE = "include";
-
+	
 	public static final String XI = "xi";
-
+	
 	protected void processStartElement() throws XMLStreamException, IOException {
 		String prefix = parser.getPrefix();
 		if (INCLUDE == localname && XI == prefix) {
@@ -334,15 +379,15 @@
 				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));
 			}
-
+			
 			writeAttributes();
 		}
 	}
-
+	
 	private void _processStartElement() throws XMLStreamException, IOException {
 		String prefix = parser.getPrefix();
 		if (INCLUDE == localname && XI == prefix) {
@@ -353,49 +398,49 @@
 				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));
 			}
-
+			
 			writeAttributes();
 		}
 	}
-
+	
 	protected void writeAttributes() throws XMLStreamException {
 		for (int i = 0; i < parser.getAttributeCount(); i++) {
 			writeAttribute(parser.getAttributePrefix(i), parser.getAttributeLocalName(i), parser.getAttributeValue(i));
 		}
 	}
-
+	
 	protected void writeAttribute(String prefix, String name, String value) throws XMLStreamException {
 		if (prefix != null && prefix.length() > 0)
 			writer.writeAttribute(prefix + ":" + name, value);
 		else
 			writer.writeAttribute(name, value);
 	}
-
+	
 	protected void processCharacters() throws XMLStreamException {
 		writer.writeCharacters(parser.getText());
 	}
-
+	
 	protected void processProcessingInstruction() throws XMLStreamException {
 		writer.writeProcessingInstruction(parser.getPITarget(), parser.getPIData());
 		if (!firstElementStarted) writer.writeCharacters("\n"); // new lines are not reported before the first element is parsed
 	}
-
+	
 	protected void processDTD() throws XMLStreamException {
 		writer.writeDTD(parser.getText());
 	}
-
+	
 	protected void processCDATA() throws XMLStreamException {
 		writer.writeCData(parser.getText());
 	}
-
+	
 	protected void processComment() throws XMLStreamException {
 		writer.writeComment(parser.getText());
 	}
-
+	
 	protected void processEndElement() throws XMLStreamException {
 		if (localname == INCLUDE && parser.getPrefix() == XI) {
 			// nothing !!
@@ -404,15 +449,15 @@
 			writer.writeEndElement();
 		}
 	}
-
+	
 	protected void processEndDocument() throws XMLStreamException {
 		writer.writeEndDocument();
 	}
-
+	
 	protected void processEntityReference() throws XMLStreamException {
 		writer.writeEntityRef(parser.getLocalName());
 	}
-
+	
 	/**
 	 * Process the XInclude elements
 	 * 
@@ -440,21 +485,21 @@
 			System.out.println("Warning referenced file: $ref does not exists");
 		}
 	}
-
+	
 	public static void main(String[] args) {
 		try {
 			File input = new File("/home/mdecorde/xml/identity/test.xml");
-			File output = new File("/home/mdecorde/xml/identity/test-copy.xml");
+			File outputFile = new File("/home/mdecorde/xml/identity/test-copy.xml");
 			if (!(input.exists() && input.canRead())) {
 				System.out.println("cannot found $input");
 				return;
 			}
 			StaxIdentityParser builder;
-
+			
 			builder = new StaxIdentityParser(input.toURI().toURL());
-
-			if (builder.process(output)) {
-				System.out.println("success ? " + ValidateXml.test(output));
+			
+			if (builder.process(outputFile)) {
+				System.out.println("success ? " + ValidateXml.test(outputFile));
 			}
 			else {
 				System.out.println("failure !");
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/transcriber/compiler.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/transcriber/compiler.groovy	(revision 2980)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/transcriber/compiler.groovy	(revision 2981)
@@ -192,7 +192,7 @@
 		cwbEn.setDebug(debug);
 		cwbMa.setDebug(debug);
 
-		String uAttr = "u:0+spkid+spk+scope+accent+s+time+check+dialect+type";
+		String uAttr = "u:0+spkid+who+scope+accent+s+time+check+dialect+type";
 		String textAttr ="text:0+base+project"
 		if (trans != null) {
 			for (String key : trans.keySet()) {
@@ -230,7 +230,7 @@
 					cqpFile.getAbsolutePath(),
 					registryFile.getAbsolutePath(), pAttributes, sAttributes);
 			if (!registryFile.exists()) {
-				println "Error: The registry file was not created: $regPath. See https://groupes.renater.fr/wiki/txm-users/public/faq"
+				println "Error: The registry file was not created: $registryFile. See https://groupes.renater.fr/wiki/txm-users/public/faq"
 				return false;
 			}
 			cwbMa.run(corpusname, registryFile.getParent());
@@ -375,7 +375,7 @@
 								String name = parser.getAttributeLocalName(i).replace("_","").toLowerCase()
 								output.write(" "+name+"=\""+parser.getAttributeValue(i).replace("\"", "&quot;")+"\"");
 								if (name == "time") formatedTime = parser.getAttributeValue(i)
-								else if (name == "spk") u_name = parser.getAttributeValue(i)
+								else if (name == "who") u_name = parser.getAttributeValue(i)
 							}
 							output.write ">\n"
 							break;
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/transcriber/TRSToTEI.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/transcriber/TRSToTEI.groovy	(revision 2980)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/transcriber/TRSToTEI.groovy	(revision 2981)
@@ -139,7 +139,7 @@
 				writer.writeEndElement() // teiHeader
 				writer.writeStartElement("text")
 				writer.writeAttribute("id", textid)
-				for(def k : informations.keySet()) writer.writeAttribute(k, informations[k])
+				for (def k : informations.keySet()) writer.writeAttribute(k, informations[k])
 				beforeBody = false; // end of info parsing
 				break;
 		}
@@ -289,7 +289,7 @@
 		def attributes = speakers.get(vSpeaker)
 		if (attributes == null) { // in case of Who@n wrong number
 			if (vSpeaker.startsWith("#") && vSpeaker.endsWith("?")) { // don't show "N/A" vSpeaker
-				writer.writeAttribute("spk", vSpeaker)
+				writer.writeAttribute("who", vSpeaker)
 				writer.writeAttribute("spkid", vSpeaker)
 				writeAttributes();
 			}
@@ -298,17 +298,18 @@
 //				println " write attribute "+p.getFirst()+" "+p.getSecond()
 				String attrn = p.getFirst().toString();
 				if (attrn == "name") { // rename @name to @spk
-					attrn = "spk"
+					attrn = "who"
 					u_name = p.getSecond();
 				} else if (attrn == "id") { // rename @id to @spkid
 					attrn = "spkid"
 				}
 
-				writer.writeAttribute(attrn,p.getSecond())
+				writer.writeAttribute(attrn, p.getSecond())
 			}
 		}
 		uOpened = true;
 	}
+	
 	private String formatTime(String time) {
 		try {
 			return formatTime(Float.parseFloat(time))
